I have the following requirement and i tried to find a solution searching old posts in the forum but couldn't find one.
The requirement is i have a sequential file fixed length 40 bytes.
The file has multiple header records and under each header, multiple detail records. The output file should have header records as-is and detail records sorted on field2 and field3 should be summed up using field 2 as key. (After summing, the field4 in detail can be from any record of the key, there is no restriction)
Header record:
Field1: 1 byte, always have value 1 to say header.
Field2: 4 bytes, any value
Field3: 35 bytes any value
Detail record:
Field1: 1 byte, always have value 2 to say detail
Field2: 4byte, any value
Field3: 3 byte, any 3 digit number
field4: 32 byte any value
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You'll have to make your mind up about Field 4. Does it matter (OPTION EQUALS, if you want the first record of a group of duplitcates to be the base)? Or not?