Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have dataset DS1 which has records say
1
2
3
4
5
...
...
etc

And also I have second dataset DS2 whcih has records
1
3
4
5
6
8
..
...

Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.

Answer Posted / vivek c

A simple way to take the matching records if there are no duplicates in both the files.

1. Merge both the files and take the duplicates in separate file using XSUM.

//S010 EXEC PGM=SORT
//SORTIN DD DSN=DSN1
// DD DSN=DSN2
//SORTOUT DD DSN=DSNOUT
//XSUM DD DSN=DSN.MATCH
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
SUM FIELDS=NONE,XSUM

The output DSN.MATCH will have the matched records.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

) what is the difference between AID and HANDLE AID?

2099


How many bytes S(8) comp field occupy and its maximum value?

2084


How do define dynamic array in cobol.

1081


Can a Search can be done on a table with or without Index?

1230


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1054


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2413


How do you define a variable of comp-1 and comp-2?

1135


How do you differentiate between cobol and cobol-ii?

1125


What are declaratives and what are their uses in cobol?

1130


how to move the records from file to array table. give with code example

2628


what is difference between cobol and cobol/400

22729


What do you understand by psb and acb?

1053


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1063


In COBOL programming, what is PERFORM? What is VARYING?

1087


What the difference is between continue and next sentence?

1101