I need to sort a file on account number but the account number exists on the header record but not the detail records. Can I utilize dfsort or icetool to copy the account number to detail records? I should be able to..... but have been trying for a couple of hours to no avail. The rest of the record should remain the same as input.
I will simplify the example. The record group is in col 1 and the account # is in col 2. The record is 200 bytes long with fb format. The before and after records are as follows:
Thus, I need for the account number to 'drop down' to the next record until a new account number is encountered. There is also a code for header and detail records. Header records can be a 0,1 or 9 while detail records can be a 3, 4, 5, or D. I left that out of the example but it exists if needed. Is this task difficult? Thank you in advance for any help you can provide.
Thank you. The header record code should not be significant but is available if the data can't be appended otherwise. The header record will always be the first record in a 'new group' as noted by a change in column 1.
With my example think of the header record as the product information regarding a sell. Detail record 1 could be the associated commission. Detail record 2 could be a regulatory fee. That information is insignificant and I think the record type code (header or trailer) is also insignificant.
If I can append the account number on all records I will sort the file on account number, record group and sequence number that I will be adding with an 'overlay seqno step'. Thank you for any help you can provide.
I have considered the i/p in this fashion
All header records will start with H in first position.
detail records may start with any character other than H
The following DFSORT/ICETOOL JCL, drops down the content in the header record from 2nd position to 4th position, to the detail records untill it encounters next header record.