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
Define cobol?
What type of SDLC u followed? Why?
What are the pertinent COBOL commands?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
How do you reference the fixed block file formats from cobol programs
HOw can I get the negative sign while deduct high value from low value
In COBOL programming, what is PERFORM? What is VARYING?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
Differentiate between structured cobol programming and object-oriented cobol programming.
What is redefines clause in COBOL?
What is the difference between next sentence and continue in cobol programing language?
Can we change the password using ALTER? anyone tried and changed?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
What rules are to be followed while using the corresponding options?
How do u write test cases?