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 the difference between AID and HANDLE AID?
How many bytes S(8) comp field occupy and its maximum value?
How do define dynamic array in cobol.
Can a Search can be done on a table with or without Index?
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)?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How do you define a variable of comp-1 and comp-2?
How do you differentiate between cobol and cobol-ii?
What are declaratives and what are their uses in cobol?
how to move the records from file to array table. give with code example
what is difference between cobol and cobol/400
What do you understand by psb and acb?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
In COBOL programming, what is PERFORM? What is VARYING?
What the difference is between continue and next sentence?