Author: mohitsaini
Subject: Validating file with multiple header/trailer
Posted: Thu Apr 13, 2017 1:53 am (GMT 5.5)
Hi All,
I have coded the below Sort step to validate file for header, trailer, and count. It is working fine for a single header and trailer.
But when there are more than 1 header and trailer in the input then it doesn't work. Meaning it doesn't throw error. Can you please advise me how to modify the below sort card to throw error for multiple header/trailer.
Specifically if I get to read the last record (which is the trailer of the concatenated files) then I can do the verification that I am currently doing on TRL. Any advise will be really appreciated. Thanks
Subject: Validating file with multiple header/trailer
Posted: Thu Apr 13, 2017 1:53 am (GMT 5.5)
Hi All,
I have coded the below Sort step to validate file for header, trailer, and count. It is working fine for a single header and trailer.
But when there are more than 1 header and trailer in the input then it doesn't work. Meaning it doesn't throw error. Can you please advise me how to modify the below sort card to throw error for multiple header/trailer.
Specifically if I get to read the last record (which is the trailer of the concatenated files) then I can do the verification that I am currently doing on TRL. Any advise will be really appreciated. Thanks
Code: |
//STEP0100 EXEC PGM=SORT,PARM='NORC16' //SYSOUT DD SYSOUT=* //SORTIN DD DSN=input.file,DISP=SHR // DD DSN=input.file,DISP=SHR ** two same files as an input doesn't give error. //SORTOUT DD SYSOUT=* //HDR DD SYSOUT=* //TLR DD SYSOUT=* //SYSIN DD * OPTION COPY INREC IFTHEN=(WHEN=INIT,OVERLAY=(181:SEQNUM,9,ZD)), IFTHEN=(WHEN=(19,6,CH,EQ,C'TRAILR'), OVERLAY=(181:181,9,ZD,SUB,+2,M11,LENGTH=9)) OUTFIL FNAMES=HDR,INCLUDE=(19,6,CH,EQ,C'HEADER'),NULLOFL=RC16 OUTFIL FNAMES=TLR,INCLUDE=(19,6,CH,EQ,C'TRAILR', AND,25,9,CH,EQ,181,9,CH), NULLOFL=RC16 //* |