SORTIN - File format
1003
1005
1000
1006
1002
1002
1005
92008092500007 ---> Trailer count is 7
SORTOUT - File format (Expected)
1000
1005
1005
92008092500003 --> Trailer count should be 3 as per the condition in JCL
The trailer should be not generated in the JCL, it should be used as it is and only the count should be changed as per the condition in JCL, since there are lots of information available in trailer which is generated by the program.
I used the following JCL, but it shows syntax error on OVERLAY..... that the COUNT function is not possible with OVERLAY
Code: Select all
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=XXXX.XXXX.XXXX
//SORTOUT DD DSN=YYYY.YYYY.YYYY,
// DISP=(OLD,CATLG,CATLG),
// UNIT=DISK,
// SPACE=(CYL,(2,1),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(((2,3,CH,EQ,C'005'),OR,(2,3,CH,EQ,C'000')),
OR,(1,1,CH,NE,C'1'))
INREC IFTHEN=(WHEN=(1,1,CH,NE,C'1'),
OVERLAY=(10:COUNT-1=(ZD,LENGTH=5))