i have requirement like this. i have input file1 in that have many records.
i have other 12 input2 files so i have comparae each record from input1 with input2 12 files if any record match then copy to the out out file
i have written below code but it is copying complete records from input2 to out put
i have comparing 1 to 18 lengh from input1 with input2
could you please help me?
STEP001 EXEC PGM=SORT
SORTJNF1 DD DSN=XXX.Q.KR0Z2R99.XXXX.ISA.OUP(0),DISP=SHR
SORTJNF2 DD DSN=xxx.P.K0101N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3211N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K2912N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0618N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3720N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4731N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0242N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4451N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1256N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4560N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1961N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3290N00.xxxx11P1.xxxxXTO(0),DISP=SHR
SORTOUT DD DSN=XXX.Q.KR0Z2R99.XXX.MAT.OUP(+1),
DISP=(NEW,CATLG,DELETE),
DCB=(LRECL=261,BLKSIZE=0,RECFM=FB),
SPACE=(CYL,(20,10),RLSE)
SYSPRINT DD SYSOUT=*
SYSOUT DD SYSOUT=*
SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,18,A)
JOINKEYS FILE=F2,FIELDS=(1,18,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2)
SORT FIELDS=COPY
SORTJNF1 DD DSN=XXX.Q.KR0Z2R99.XXXX.ISA.OUP(0),DISP=SHR
SORTJNF2 DD DSN=xxx.P.K0101N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3211N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K2912N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0618N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3720N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4731N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0242N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4451N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1256N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4560N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1961N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3290N00.xxxx11P1.xxxxXTO(0),DISP=SHR
SORTOUT DD DSN=XXX.Q.KR0Z2R99.XXX.MAT.OUP(+1),
DISP=(NEW,CATLG,DELETE),
DCB=(LRECL=261,BLKSIZE=0,RECFM=FB),
SPACE=(CYL,(20,10),RLSE)
SYSPRINT DD SYSOUT=*
SYSOUT DD SYSOUT=*
SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,18,A)
JOINKEYS FILE=F2,FIELDS=(1,18,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2)
SORT FIELDS=COPY
added the code tags