Ron, If both input files have the same DCB properties , the solution posted by Norbert Friemel will work. It also assumes that you do NOT have non matching duplicates. If the files have different DCB's or have non matching duplicates then you can use the following DFSORT JCL
//STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //INA DD * ----+----1----+----2----+----3----+----4----+---- 100000038 004366456 100000039 494165545 100000040 497228431 100000041 408506918 //INB DD * 100000038 4366456 100000039 494165545 100000040 497228431 100000041 408506918 100000041 408506912 //SORTOUT DD SYSOUT=* //SYSIN DD * OPTION COPY JOINKEYS F1=INA,FIELDS=(1,9,A,12,9,A) JOINKEYS F2=INB,FIELDS=(1,9,A,12,9,A) JOIN UNPAIRED,F2,ONLY //* //JNF1CNTL DD * INREC OVERLAY=(12:12,9,UFF,M11,LENGTH=9) //* //JNF2CNTL DD * INREC OVERLAY=(12:12,9,UFF,M11,LENGTH=9) //* Sri Hari Kolusu DFSORT Development IBM Corporation IBM Mainframe Discussion List <[email protected]> wrote on 10/17/2012 02:15:13 AM: > From: Ron Thomas <[email protected]> > To: [email protected], > Date: 10/17/2012 02:15 AM > Subject: sort jcl > Sent by: IBM Mainframe Discussion List <[email protected]> > > Hello. > > I have 2 files, I need to compare using DFSORT. Could someone please > let me know how we can acheive? > > File-1 > > 100000038 004366456 > 100000039 494165545 > 100000040 497228431 > 100000041 408506918 > > File-2 > > 100000038 4366456 > 100000039 494165545 > 100000040 497228431 > 100000041 408506918 > 100000041 408506912 > > Output file > 100000041 408506912 > > Regards > Ron T > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
