My input data contain one header record (like H1,H2,H3) followed by some detail records (like D1,D2,D3,D4).
Now I need to sort my input data based on ID in the position 11-13. Constraint is that the corresponding header record should come along with the detail records.
Few important things:
1) In the header record, we don't have the ID and in the position 11-13 and some other value is present which is required for some other processing. So we should not overlay the header record data in the position 11-13.
2) The common value between the header and detail record is in the postions 1-5.
3) There is no fixed number of header or detail records count.
4) In the group of detail records (under one header) the ID (in the positions 11-13) is same.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 13, 2009 11:05 am Post subject:
anandmsteds,
The following DFSORT JCL will give you the desired results. I assumed that you have 'h' for header record and 'd' for detail record in byte 10 (4 bytes rdw + 5 byte key + 1 byte to denoting 'h' or 'd')
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum