z/OS DFSORT: Getting Started
|
Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Splitting z/OS DFSORT: Getting Started SC23-6880-00 |
|||
|
Suppose you don't know how many records are in a data set, but
you want to divide the records as equally as possible between two
output data sets. You can use OUTFIL's SPLIT parameter to put the
first record into OUTPUT1, the second record into OUTPUT2, the third
record into OUTPUT1, the fourth record into OUTPUT2, and so on until
you run out of records. SPLIT splits the records one at a time among
the data sets specified by FNAMES. The following statements split
the records between two OUTFIL data sets:
With 17 input records, the results produced for OUTPUT1 are:
The results produced for OUTPUT2 are:
Similarly, OUTFIL's SPLITBY=n parameter splits the records n at
a time among the data sets specified by FNAMES. The following statements
split the records four at a time between three OUTFIL data sets:
With 17 input records, the results produced for OUT1 are:
The results produced for OUT2 are:
The results produced for OUT3 are:
SPLIT and SPLITBY=n both start over with the first ddname after writing records to the last ddname. This can give you non-contiguous records in one or more of the OUTFIL data sets. For example, in the previous example with SPLITBY=4, OUT1 has records 1-4 and 13-16. If instead, you only want contiguous records in each OUTFIL data set, you can use OUTFIL's SPLIT1R=n parameter which writes n records to each OUTFIL data set and then writes the remaining records to the last OUTFIL data set. Thus, whereas SPLIT and SPLITBY=n rotate many times among the OUTFIL data sets, SPLIT1R=n only rotates once among the OUTFIL data sets. The following statements ensure that the records are split with
only contiguous records in each OUTFIL data set:
With 17 input
records, the results produced for OUTA are:
The results produced for OUTB are:
The results produced for OUTC are:
|
Copyright IBM Corporation 1990, 2014 |