DATASET-HEADER - several records (number unknown) to describe the data.
RECORD1-START (identifiable)
...
data records (number unknown)
...
RECORD1-END (identifiable)
RECORD1-TRAILER-DATA (exactly 3 records)
RECORD2-START (identifiable)
...
data records (number unknown)
...
RECORD2-END (identifiable)
RECORD2-TRAILER-DATA (exactly 3 records)
..
and so on until end of data.
My task is to "move" the 3 RECORD-TRAILER-DATA records, so that they appear right before each RECORD-END in the same order as before. If you choose, you can move the RECORD-END below the 3 RECORD-TRAILERs - the result should be the same.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Claes Norreen,
The following DFSORT JCL will give you the desired results. I assumed that each group starts with word "start" in pos 9 and the RECORD-END will be the only record which will have END at pos 9. This record will be moved to the end of the group.
Unfortunately I messed the input up a bit. Sorry about that. Can you give directions on this one too, please? The big difference is that a new record actually start before the trailer data. I also added the EOF-marker.
Also, TRAILER-DATA2 and TRAILER-DATA3 are identical, and if possible, one of them should be removed from the output.