DFSORT Control StatementsDFSORT Datasets and Rules DFSORT Coding Sheet & Rules
DFSORT control statements have logically can be divided into two parts.
- Primary control statements
- Secondary control statements
Primary control statements:
The primary control statements are
The primary control statements are mandatory for DFSORT.
No two control statements can 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.
Describes control fields if coding a sort process, or specifies a copy application.
Indicates whether ascending or descending order for the sort.
Describes control fields if coding a merge process, or specifies a copy application.
Indicates whether ascending or descending order for the merge.
Overrides installation defaults (EQUALS, CHALT, and CHECK) and supplies optional information
Can specify 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 below are different types of secondary control statements.
- Including or omitting records
- Reformatting and editing records
- Producing multiple output and reports and converting records
- Join 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 data sets or omitted from them.
INCLUDE option specifies that only records whose fields meet certain criteria are included.
OMIT option specifies that any records whose fields meet certain criteria are deleted.
OUTFIL option specifies the records to be included or omitted in multiple output data sets.
Reformatting and editing records
This option specifies the modify options of individual records by deleting and reordering fields and inserting blanks, zeros, 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 output and 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" applications 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 the 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.
And 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 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 that numeric summary fields in records with equal control fields are summed in one record and that the other records are deleted.
DFSORT Datasets and Rules DFSORT Coding Sheet & Rules