Hi,
I have a file of FB format and 80 LRECL with following input records:
00 XXX Header Data Record
10 001 Detail Data Record
10 002 Detail Data Record
10 003 Detail Data Record
99 003 Trailer Data Record
00 XXX Header Data Record
10 001 Detail Data Record
99 001 Trailer Data Record
00 XXX Header Data Record
10 001 Detail Data Record
10 002 Detail Data Record
99 002 Trailer Data Record
what I want in my output file is:
1. Remove Duplicate Header Records (if First 2 bytes = '00'), and keep only one header record in the output file.
2. copy all the data records as it is (if First 2 bytes = '10')
3. remove duplicates for trailer records (if First 2 bytes = '99') and also sum up the field positioned from col 3 to 6 in to the final trailer record.
henceforth my output file for the above input should be like this:
00 XXX Header Data Record
10 001 Detail Data Record
10 002 Detail Data Record
10 003 Detail Data Record
10 001 Detail Data Record
10 001 Detail Data Record
10 002 Detail Data Record
99 006 Trailer Data Record
Please suggest a sort card for the same. Also it would be great if anybody can tell me if it would be more efficient than writing a COBOL program for the same.
I tried to find a solution for this but I didn't find any example where SUMFIELDS can be used along with INREC IFTHEN.
Thanks,
Hardik