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 compute verb? How is it used?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
What is the difference between Call and a Link?
explain sorting techniques in cobol program?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What are the different data types in cobol?
Discuss about changing dataset name in proc.
Explain the configuration section of a cobol program with examples of syntax.
What are 77 levels used for?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
how to refer the data field?
What are the different open modes available in cobol?
what is the use of outrecord?