//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD DISP=SHR,DSN=Your Input FB 600 Byte file
//INB DD DISP=SHR,DSN=Your Input FB 80 Byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(06,9,A)
JOINKEYS F2=INB,FIELDS=(10,9,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,600,?,F2:1,9)
INREC IFOUTLEN=600,
IFTHEN=(WHEN=(601,1,CH,EQ,C'B'),OVERLAY=(20:602,9))
//*
//SYSOUT DD SYSOUT=*
//INA DD DISP=SHR,DSN=Your Input FB 600 Byte file
//INB DD DISP=SHR,DSN=Your Input FB 80 Byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(06,9,A)
JOINKEYS F2=INB,FIELDS=(10,9,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,600,?,F2:1,9)
INREC IFOUTLEN=600,
IFTHEN=(WHEN=(601,1,CH,EQ,C'B'),OVERLAY=(20:602,9))
//*
to get to
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=A
//INA DD DISP=SHR,DSN=D.WIT.WRK.ALMTBALS
//INB DD DISP=SHR,DSN=D.WIT.WRK.ALMT.BALS
//SORTOUT DD SYSOUT=A
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,32,A,81,39,A)
JOINKEYS F2=INB,FIELDS=(1,32,A,81,39,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,455,?,F2:33,48)
INREC IFOUTLEN=455,
IFTHEN=(WHEN=(456,1,CH,EQ,C'B'),OVERLAY=(33:457,48))
/*
//SYSOUT DD SYSOUT=A
//INA DD DISP=SHR,DSN=D.WIT.WRK.ALMTBALS
//INB DD DISP=SHR,DSN=D.WIT.WRK.ALMT.BALS
//SORTOUT DD SYSOUT=A
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(1,32,A,81,39,A)
JOINKEYS F2=INB,FIELDS=(1,32,A,81,39,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,455,?,F2:33,48)
INREC IFOUTLEN=455,
IFTHEN=(WHEN=(456,1,CH,EQ,C'B'),OVERLAY=(33:457,48))
/*
In the IFTHEN, why should it be looking for a B in position 456? Also, do I have this setup correctly to replace values from file2 in file1 when the keys match and to keep unpaired records in file1?
Thank you,
Brad