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
What is an in line perform? When would you use it? Anything else you wish to say about it.
Name the divisions, which are available in a cobol program?
How do you reference the following file formats from cobol programs?
What is length is cobol?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
How do you differentiate between cobol and cobol-ii?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What is inspect in cobol ?
Write a program to enter and display the names of students in a class using the occurs clause.
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
Define cobol?
What are the different rules for performing sort operation?
What is redefines clause in COBOL?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?