Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Including, omitting, and saving discards z/OS DFSORT: Getting Started SC23-6880-00 |
|||||||||||||||||||||||||||
In Including or omitting records, you learned how to use the INCLUDE and OMIT statements to select only a subset of the input records for sorting, copying or merging. You can also select subsets of records for your individual OUTFIL output data sets in the same way using the INCLUDE and OMIT parameters. Different INCLUDE or OMIT parameters can be used for different OUTFIL statements. All of the logical expressions that are valid for the COND parameter of the INCLUDE and OMIT statements are also valid for the INCLUDE and OMIT parameters of OUTFIL. However, you cannot specify the FORMAT parameter with the OUTFIL statement as you can with the INCLUDE and OMIT statements. VB data set considerations for the INCLUDE and OMIT statements also apply to the INCLUDE and OMIT parameters. Suppose you wanted to sort the bookstore data set by title, and
create separate output data sets for the English, History and Psychology
departments. You could use the following OUTFIL statements to create
these three output data sets:
The SORT statement sorts the input records by the title field. The first OUTFIL statement writes the records for the English department
to the ENGLOUT data set. The result is shown in Table 1.
The second OUTFIL statement writes the records for the History
department to the HISTOUT data set. The result is shown in Table 2.
The third OUTFIL statement writes the records for the Psychology
department to the PYSCHOUT data set. The result is shown in Table 3.
The previous example creates output data sets for the English,
History and Psychology department's books. If you wanted to create
an additional output data set (RESTOUT) containing the rest of the
books, you could use the following statements:
This is not too bad for only three departments, but the INCLUDE statement for RESTOUT would get more involved as the number of departments increased. DFSORT's SAVE parameter gives you an easy way to keep the records
discarded by a group of OUTFIL statements. The SAVE parameter selects
records for its OUTFIL data set that are not selected for any other
OUTFIL data set as a result of the INCLUDE, OMIT, ACCEPT,
STARTREC, ENDREC or SAMPLE parameters. So instead of the preceding
statements, you could use the following statements to accomplish the
same thing
The fourth OUTFIL statement writes the records not used for English,
History or Psychology to the RESTOUT data set. The result is shown
in Table 4.
|
Copyright IBM Corporation 1990, 2014
|