How to Use DFSORT Utility in JCL

Here is sample Job parameters that you need to use DFSORT utility either directly or indirectly. This post tells you more on this.

The below are the list of Parameters to be used in DFSORT job.

JCL Job parameters

JCL should include a JOB statement, an EXEC statement, and several DD statements. The statements you need and their exact form depend upon whether you: Invoke DFSORT with an EXEC statement in the input job stream, or with a system macro instruction within another program

  • use EXEC statement cataloged procedures to invoke DFSORT
  • specify PARM options on the EXEC statement
  • specify PARM options or control statements in a DFSPARM data set
  • specify control statements in a SYSIN data set

JCL Parameters You Need When You Use DSFORT Utility

//jobname JOB

Signals the beginning of a job. At your site, you might be required to specify information such as your name and account number on the JOB statement.

//stepname EXEC

Signals the beginning of a job step and tells the operating system what program to run. To run DFSORT, write the EXEC statement like this:

//stepname EXEC PGM=SORT

//STEPLIB DD

The DFSORT program would typically be in a library known to the system, so the //STEPLIB DD statement would not be needed. However, if DFSORT is not in a library known to the system, the //STEPLIB DD statement defines the library containing the DFSORT program

//SYSOUT DD

Defines the data set in which DFSORT messages and control statements are listed.

//SORTIN DD

Defines the input data set or concatenated input data sets.

//SORTWKdd DD

Defines a work data set for a sort. Typically not needed, because DFSORT can allocate work data sets for a sort dynamically.

//SORTOUT DD

Defines the output data set.

//SYSIN DD

Precedes or contains the DFSORT program control statements.

(Ref:IBM)

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.