In this topic, we described about the below sections -
DFSORT control statements can logically divided into two types.
- Primary control statements
- Secondary control statements
Primary control statements:
The primary control statements are
The primary control statements are mandatory for DFSORT. Two primary control statements should not be coded together in DFSORT. Primary control statements can be coded in the combination with secondary control statements. Let’s discuss about primary control lines in detail.
Specifies the control fields for a sort process, or a copy application. Specifies the fields, fields type and sorting order. Sorting order can be either ascending or descending order.
Specifies control fields for a merge process, or a copy application. Specifies the fields, fields type and sorting order. Sorting order can be either ascending or descending order.
Overrides installation defaults (EQUALS, CHALT and CHECK) and supplies optional information Specifies for a copy process.
Secondary control statements:
The secondary control statements can be coded along with the primary control statements. The secondary control statements used to reformat the input data.
The secondary control statements can be coded along with primary control statements for additional processing. The below are different types of secondary control statements.
- Including or Omitting records
- Reformatting and editing records
- Producing multiple outputs, reports and converting records
- Joining two files
- Additional functions and options
Lets discuss about each option in detail.
Including or Omitting records
This option specifies whether certain records are included in the output datasets or omitted from output datasets.
INCLUDE option used to specify the criteria and the records which satisfies the criteria will be copied to output.
OMIT option used to specify the criteria, the records which satisfies the criteria will be ignored. The remaining records which are not satisfies the criteria will be copied to output.
OUTFIL option specifies how records are included in the output datasets or omitted from output datasets.
Reformatting and editing records
This option used to individual records by deleting, reordering fields and inserting blanks, zeroes or constants.
INREC option specifies how records are reformatted before they are sorted, copied, or merged.
OUTREC option specifies how records are reformatted after they are sorted, copied, or merged.
OUTFIL option specifies how records are reformatted in multiple output data sets.
Producing multiple outputs, reports and converting records
This option specifies to produce multiple output data sets and reports, convert variable-length records to fixed-length records and convert fixed-length records to variable-length records.
OUTFIL option specifies how records are to be converted from variable-length to fixed-length or from fixed-length to variable-length.
Joining two files
This option specifies to perform various types of "join" operations on two files (F1 and F2) by one or more keys.
One JOINKEYS statement is required for each input file to indicate the ddname of the file.
An inner join is performed by default, but a JOIN statement can be used to specify a different type of join.
Describes the fields from the two files to be included in the joined records. Optionally an indicator of where the key was found ('B' for both files, '1' for file1 only or '2' for file2 only).
Additional functions and options
These are remaining control statements to perform a variety of tasks.
ALTSEQ option specifies the changes to the ALTSEQ translation table to be used for SORT, MERGE, INCLUDE or OMIT fields with format AQ. Also for INREC, OUTREC, and OUTFIL fields with TRAN=ALTSEQ, and for INREC, OUTREC, and OUTFIL fields with format AQ in logical expressions.
DEBUG option specifies for various diagnostic options.
END option causes DFSORT to discontinue reading SYSIN, SORTCNTL, or DFSPARM.
RECORD option can be used to supply length and type information.
SUM option specifies numeric summary fields of all records with equal control fields are summed in one record and that the other records are deleted.