问题
could you please help to get results for below requirement
- the file 1 having only 18 fixed length data to compare with file 2
- if any matching records then copy the complete matching record from file 2 to output1 and the non-matching records from file 1 and file 2 to other output2
- input1 file length 18 input2 file length 503
i have joined 12 files into single file like this
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
here just i tried to copy the only matching records but the out file got complete records from input2
来源:https://stackoverflow.com/questions/52761373/comapare-file1-with-12-file-then-copy-the-matched-records-one-file-and-unmatch-r