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 are JCLLIB and STEPLIB in JCL?
What is the significance of addrspc parameter in exec statement?
can any one plzzzzzz tell the jcl code for creating ps using idcams
How can return codes be tested before execution of a job step?
What is the difference between run mode and addressing mode?
Name the statement which can be used to send data to another mvs jes3 node?
A dd statement consists of 4 fields. Name them?
Explain how can a stopped job be started again?
when can a job time-out occur? How to overcome that?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
When space is allocated for an output dataset, what units can be used?
State the uses of syspring, sysin, sort fields, sum fields and dummy.
Which dd parameters are required?
whats the diff bw the evaluate also and and?
Explain the function of job statement in jcl?