File1 has 100 records and file2 has 200 records i want to
copy 50 records which r in both file into file3
Answer Posted / madhavi chava
This can be coded as given below
//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
00000111111 000001234567 LOCAL =====
00000333333 000003456789 LOCAL =====
00000555555 000005678901 EXTRN =====
00000666666 000006789012 EXTRN =====
00000777777 000007890123 LOCAL =====
//SORTJNF2 DD *
00000222222 000002345678 ===== BCDEF
00000444444 000004567890 =====
DEFGH
00000666666 000006789012 ===== FGHIJ
00000888888 000008901234 ===== HIJKL
00000999999 000009012345 ===== JKLMN
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,11,A,13,12,A)
JOINKEYS FILES=F2,FIELDS=(1,11,A,13,12,A)
REFORMAT FIELDS=(F1:1,31,F2:32,5)
SORT FIELDS=COPY
output of the file3
00000666666 000006789012 EXTRN FGHIJ
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the difference between run mode and addressing mode?
What is timing concept in mainframe?
what is use of disp parameter in dd statement?
which utility is used to run a cobol-db2 program?
what is use of dcb parameter in dd statement?
When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?
What is the format of comment statement?
Is automatic restart possible in jcl? If yes, how?
How to do automated restart when a job abend?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
Explain about LMQUERY�give a dialog information about a data set
What is the function of the dd avgrec keyword in sms datasets?
What is job control language?
Explain dfsort utility?
Is automatic restart possible in jcl?