DFSORT Control Statements

DFSORT Datasets and Rules DFSORT Coding Sheet & Rules

Advertisements


DFSORT control statements have logically can be divided into two parts.

  1. Primary control statements
  2. Secondary control statements

Primary control statements:

The primary control statements are

  1. SORT
  2. MERGE
  3. OPTION

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.

SORT

Describes control fields if coding a sort process, or specifies a copy application.

Indicates whether ascending or descending order for the sort.

MERGE

Describes control fields if coding a merge process, or specifies a copy application.

Indicates whether ascending or descending order for the merge.

OPTION

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.

  1. Including or omitting records
  2. Reformatting and editing records
  3. Producing multiple output and reports and converting records
  4. Join two files
  5. 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

INCLUDE option specifies that only records whose fields meet certain criteria are included.

OMIT

OMIT option specifies that any records whose fields meet certain criteria are deleted.

OUTFIL

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

INREC option specifies how records are reformatted before they are sorted, copied, or merged.

OUTREC

OUTREC option specifies how records are reformatted after they are sorted, copied, or merged.

OUTFIL

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

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.

JOINKEYS

One JOINKEYS statement is required for each input file to indicate the ddname of the file.

JOIN

An inner join is performed by default, but a JOIN statement can be used to specify a different type of join.

REFORMAT

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

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

DEBUG option specifies various diagnostic options.

END

END option causes DFSORT to discontinue reading SYSIN, SORTCNTL, or DFSPARM.

RECORD

RECORD option can be used to supply length and type information.

SUM

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

Advertisements