Hi,
I have a input file of type FB and lrecl = 80.
The layout is as shown
Key 9(10) 1-10
Date s9(5) comp-3 11-13
Seq no: s9(5) comp-3 14-16
rec-type 9(3) 36-38
amount s9(11)V99 COMP-3 41-47
i need to sort all the input records based on the key,date and rec-type.
Then i need to sum the records having rec type = 100 and rec-type = 200 into 1 record with rec-type = 150 , the amount needs to be summed up and all other data needs to be from any of the two records.
then i have to increment the seq num in such a way that for every key the number starts from 1 and incremented by 1. Once the key changes, the sequence has to restart from 1 for the next key.
Also for a key, ther can be no recs of type = 100 and 200 or can contain only 1 type or both may be present. (The no of occurances is also not constant).
There may be other records in between rec-type = 100 and 200. (But if needed i can sortout only these records and do the required operations on them. But in that case i will need to perform the sequencing only after joining these records with the original ones).
Please help.
I have syncsort and not dfsort.