Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 28 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
This example illustrates how you can INCLUDE specific relative records from groups of VB records. We insert a sequence number between the RDW and the first data byte of each record. The sequence number restarts at 1 for the first record in each group. We INCLUDE on the sequence number and then remove it. The VB input records might look like this:
We use an IFTHEN WHEN=INIT clause to reformat each record so it
has room for the 3-byte sequence number between the RDW and the first
data byte. After the WHEN=INIT clause is executed, the intermediate
records look like this:
Note that positions 5-7 are blank and the 'PAGE:' characters have been shifted over to positions 8-12. We use an IFTHEN WHEN=GROUP clause to put a 3-byte sequence number
in each record. BEGIN indicates a group starts with a record that
has 'PAGE:' in positions 8-12. PUSH overlays a 3-byte sequence number
at positions 5-7 of each record. The sequence number starts at 1
for the first record of a group and is incremented by 1 for each subsequent
record of the group. After the IFTHEN GROUP clause is executed, the
intermediate records look like this:
Note that the records in each group are numbered starting with 001 for the first record of each group. The records we want have sequence numbers 002 and 003. We use an OUTFIL statement to only INCLUDE the records with sequence
number 002 or 003, and to remove the sequence numbers so the included
output records will be identical to the input records. After the
OUTFIL statement is executed, the final output records look like this:
|
Copyright IBM Corporation 1990, 2014
|