In Summary:
INPUT1 contains a record which provides output print formatting.
INPUT2 contains a record which is output.
INPUT3 contains a date (dd/mm/yy) value which is to be overlaid on the record output from INPUT2.
INPUT4 contains a record which begins with x'15' between each word. Each x'15' is to be replaced by x'40' in the output.
INPUT9 contains a record which provides print formatting record, and another record which is output.
Grateful for advice.
Regards, Kevin
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TMP1 DD DSN=&&TMP1,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//TMP2 DD DSN=&&TMP2,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//TMP3 DD DSN=&&TMP3,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//INPUT1 DD *
1¬$FMT = "Portrait"!
//INPUT2 DD *
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS START
//INPUT3 DD *
07/04/10
//INPUT4 DD *
THIS IS A INPUT4 DATA RECORD
//INPUT9 DD *
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS END
//OUTPUT1 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INPUT1) TO(TMP1)
COPY FROM(INPUT2) TO(TMP2) USING(DFS1)
COPY FROM(INPUT3) TO(TMP2) USING(DFS2)
SPLICE FROM(TMP2) TO(TMP3) ON(81,2,PD) WITH(41,8) USING(DFS3)
COPY FROM(TMP1) TO(OUTPUT1)
COPY FROM(TMP3) TO(OUTPUT1)
COPY FROM(INPUT4) TO(OUTPUT1) USING(DFS4)
COPY FROM(INPUT9) TO(OUTPUT1)
//DFS1CNTL DD *
OUTREC BUILD=(1:1,45,81:SEQNUM,2,PD)
OPTION STOPAFT=1
//DFS2CNTL DD *
OUTREC BUILD=(41:1,8,81:SEQNUM,2,PD)
OPTION STOPAFT=1
//DFS3CNTL DD *
OUTFIL FNAMES=TMP3,BUILD=(1,48,207X)
//DFS4CNTL DD *
OUTREC FINDREP=(IN=X'15',OUT=X'40')
OPTION COPY
...produces output. Note date (dd/mm/yy) has been overlaid on the record that originated from INPUT2, and (although you cannot see it here) x'40' has replaced each x'15' in the record that originated from INPUT4.
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS 07/04/10
THIS IS A INPUT4 DATA RECORD
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS END
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TMP1 DD DSN=&&TMP1,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//TMP2 DD DSN=&&TMP2,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//TMP3 DD DSN=&&TMP3,DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,1),RECFM=FBA,LRECL=255
//INPUT1 DD *
1¬$FMT = "Portrait"!
//INPUT2 DD *
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS START
//INPUT3 DD *
07/04/10
//INPUT4 DD *
THIS IS A INPUT4 DATA RECORD
//INPUT9 DD *
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS END
//OUTPUT1 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INPUT1) TO(TMP1)
COPY FROM(INPUT2) TO(TMP2) USING(DFS1)
COPY FROM(INPUT3) TO(TMP2) USING(DFS2)
SPLICE FROM(TMP2) TO(TMP3) ON(81,2,PD) WITH(41,8) USING(DFS3)
COPY FROM(TMP1) TO(OUTPUT1)
COPY FROM(TMP3) TO(OUTPUT1)
COPY FROM(INPUT4) TO(OUTPUT1) USING(DFS4)
COPY FROM(INPUT9) TO(OUTPUT1)
//DFS1CNTL DD *
OUTREC BUILD=(1:1,45,81:SEQNUM,2,PD)
OPTION STOPAFT=1
//DFS2CNTL DD *
OUTREC BUILD=(41:1,8,81:SEQNUM,2,PD)
OPTION STOPAFT=1
//DFS3CNTL DD *
OUTFIL FNAMES=TMP3,BUILD=(1,48,207X)
//DFS4CNTL DD *
OUTREC FINDREP=(IN=X'15',OUT=X'40')
OPTION COPY
...produces output. Note date (dd/mm/yy) has been overlaid on the record that originated from INPUT2, and (although you cannot see it here) x'40' has replaced each x'15' in the record that originated from INPUT4.
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS 07/04/10
THIS IS A INPUT4 DATA RECORD
1¬$FMT = "Portrait"!
>>PRINTED XXXXXXXXXX ACKNOWLEDGEMENTS END