Author: RahulG31
Subject: Reply to: Check if any Detail records and extract count from Trailer
Posted: Mon May 08, 2017 11:50 pm (GMT 5.5)
This should give you the desired result but you'll get the output with count 0 if no '02' found. There may be better solutions available![icon_confused.gif]()
Subject: Reply to: Check if any Detail records and extract count from Trailer
Posted: Mon May 08, 2017 11:50 pm (GMT 5.5)
This should give you the desired result but you'll get the output with count 0 if no '02' found. There may be better solutions available

Code: |
//STEPSORT EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SORTIN DD * 01 HEADER 03 DETAIL 03 DETAIL 03 DETAIL 99 0000003 //OUT1 DD SYSOUT=* //OUT2 DD SYSOUT=* //SYSIN DD * OPTION COPY INCLUDE COND=(1,2,ZD,EQ,02) OUTFIL FNAMES=OUT1, TRAILER1=(C'TEXT1',/,C'TEXT2',COUNT),NODETAIL OUTFIL FNAMES=OUT2, TRAILER1=(C'TEXT1',/,C'TEXT2',COUNT),NULLOFL=RC4 /* |