kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Aug 24, 2018 4:14 pm Post subject: |
|
|
BMW1,
Couple of ways. The easiest and simple way is to generate a Symbol for file-1 date and using it in the second step.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2018-07-16
//SORTOUT DD DSN=&&S,DISP=(,PASS),SPACE=(TRK,(1,0))
//SYSIN DD *
OPTION COPY,STOPAFT=1
OUTREC BUILD=(C'RDATE,C''',1,10,C'''',80:X)
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DISP=(OLD,PASS),DSN=&&S
//SORTIN DD *
REC1 DATA
REC2 DATA
REC3 DATA
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(RDATE,1,80)
//*
|
Or you can use JOINKEYS to match on a psuedo key
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
REC1 DATA
REC2 DATA
REC3 DATA
//INB DD *
2018-07-16
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(81,1,A),SORTED,NOSEQCK
JOINKEYS F2=INB,FIELDS=(81,1,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F2:1,10,F1:1,80)
//*
//JNF1CNTL DD *
INREC OVERLAY=(81:X)
//*
//JNF2CNTL DD *
OPTION STOPAFT=1
INREC OVERLAY=(81:X)
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|