Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's still not clear what you want to do.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.
OUTPUT:
AA2007-07-12ABCDE D
DDDDD 00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL
ZZ
Here the output trilar record(Packed Decimal) has record count of 4 where it has to be 1.
I have used the fllowing code:
//S1 EXEC PGM=SORT
//SORTIN DD *
AA2007-07-12HFRINS D
DDDDD 00000000000000111111111MBRBRAHMAN ABC - AXEA VOERL
DDDDD 00000000000000232131231MALLIKAJUN RED - ABYC EREAD
DDDDD 000000000000001212161212MIREREEAIA AEA TESTING
DDDDD 00000000000000121210911LMI REDDO EVW TESTING
ZZ
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,2,AQ,A)
ALTSEQ CODE=(C1F2,C6F9,C4F3,E9F9)
SUM FIELDS=NONE
Please let me know how to update the trialer count.
(The output of abouve query alwas has one record) I am fine with updating(Default) as 1 for Trailer Record.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Well, you didn't give the starting position or length of the PD count field you want in the ZZ record, so I'll assume it starts in position 3 and has a length of 8 bytes. Here's a DFSORT job that will do what you asked for with those assumptions. Change as needed.