http://ibmmainframes.com/about6082.html
I used the following JCL :
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create a DFSORT symbol as follows:
* TARG,C'abcd'
* where abcd is the value in positions 1-4
OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Use the TARG symbol created in S1 to do the overlay.
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'1234'),OVERLAY=(1:TARG))
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create a DFSORT symbol as follows:
* TARG,C'abcd'
* where abcd is the value in positions 1-4
OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Use the TARG symbol created in S1 to do the overlay.
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'1234'),OVERLAY=(1:TARG))
/*
In this overall I understand that input is put into a variable named "TARG" and used in the S2 to pass in the OVERLAY statement present in sysin.But i could understand how the following outrec statement in S1 works:
OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)
When i saw the output of step S1 it was like : TARG,C'abcd'.
Please explain this if possible !
I would like to thank Frank Yaeger for posting this reference JCL in this forum.
Thanks with Regards,
Maandi.