My input record starts with T is a trailer record. We have 3 trailer records from the input file.
Key is in the 10th position with the length 5. I want to update all the trailer records as below. Could you please suggest me on this.
My DFSORT control card is
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(10,5,CH,EQ,C'ABC '),
IFTRAIL=(TRLID=(1,1,CH,EQ,C'T',AND,7,3,CH,EQ,C'ABC'),
TRLUPD=(20:COUNT=(EDIT=(TTTT))))
OUTFIL FILES=01,
INCLUDE=(10,5,CH,EQ,C'ABC '),
IFTRAIL=(TRLID=(1,1,CH,EQ,C'T',AND,7,3,CH,EQ,C'ABC'),
TRLUPD=(20:COUNT=(EDIT=(TTTT))))
Input file -> 80 byte and fixed length:
10 AAAA HI
10 AAAA ABC
10 AAAA XYZ
10 AAAA ABC
10 AAAA XYZ
10 AAAA HI
10 AAAA HI
10 AAAA ABC
10 AAAA HI
10 AAAA HI
10 AAAA HI
TRAIL ABC 100
TRAIL HI 200
TRAIL XYZ 300
After submitting the JOB i am getting the below output:Output file -> 80 byte and fixed length
10 AAAA ABC
10 AAAA ABC
10 AAAA ABC
TRAIL ABC 100 0003
But the expected output format is given below: I want to update the trailer record for all the condition and write it in a single file.
Expected output -> 80 byte and fixed length
10 AAAA HI
10 AAAA ABC
10 AAAA XYZ
10 AAAA ABC
10 AAAA XYZ
10 AAAA HI
10 AAAA HI
10 AAAA ABC
10 AAAA HI
10 AAAA HI
10 AAAA HI
TRAIL ABC 100 0003
TRAIL HI 200 0006
TRAIL XYZ 300 0002
Thank you..