comapare file1 with 12 file then copy the matched records one file and unmatch records other files using jcl

家住魔仙堡 提交于 2019-12-13 04:09:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!