The key is 60 bytes field
Then there is a 20 byte filed.
The last two bytes of the file is Contract count.
I need to add the contract counts(last two bytes) of the records which matches from 1 -60 (matching keys). There can be only 2 repeating keys(duplicates for every key). The condition is such that If there is a duplicate, then if second repeating key record has 'C01 ' in the 20 byte record, then add the last 2 bytes of these records. The record retained should have the value of the first repeating key in the 20 bytes field.
for the data shown above the output should be like :-
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
bijoybabu83,
The first 4 records all have the same key in the first 60 bytes. How do you distinguish the keys?
Are the records already sorted on the first 60 bytes? And every 2 records is considered as a set of keys? Do you have orphan keys ( only 1 record present)
1. Regarding the data given, it seems to be wrong. There can only be 2 duplicates. So please consider the last two records to have 304 in postion of 303.
2. All the records are sorted on the first 60 bytes.
3. There can be orphan keys.
For example consider the input data can look like :-
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
bijoybabu83,
Use the following DFSORT Control cards. Remember that your summing field is only 2 bytes and if the total is greater than 99 you would still get duplicate records