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 an in line perform? When would you use it? Anything else you wish to say about it.

1083


Name the divisions, which are available in a cobol program?

1243


How do you reference the following file formats from cobol programs?

1171


What is length is cobol?

1111


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1359


How do you differentiate between cobol and cobol-ii?

1221


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3266


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1359


What is inspect in cobol ?

1312


Write a program to enter and display the names of students in a class using the occurs clause.

1219


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1250


Define cobol?

1414


What are the different rules for performing sort operation?

1232


What is redefines clause in COBOL?

1301


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

1119