z/OS DFSORT Tuning Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Invoking DFSORT from COBOL

z/OS DFSORT Tuning Guide
SC23-6882-00

In order to invoke DFSORT from COBOL, you must code a COBOL SORT statement. This statement has the following variations which affect the way in which DFSORT and COBOL pass information back and forth:
  • USING
  • GIVING
  • INPUT PROCEDURE
  • OUTPUT PROCEDURE

In addition, the COBOL compile-time options FASTSRT and NOFASTSRT also affect the interfaces between COBOL and DFSORT.

The interfaces that result from the COBOL SORT statement and the FASTSRT/NOFASTSRT compile-time options are described in Processing with FASTSRT and Processing with NOFASTSRT.

When a COBOL calling program is used, DFSORT control statements can be specified using the COBOL data set defined by IGZSRTCD or the DFSORT data set defined by SORTCNTL or DFSPARM. There are some differences in how these data sets can be used. For example:
  • SORTCNTL allows you to specify comment statements, blank statements, remarks, and labels. DFSPARM allows comment statements, blank statements, and remarks, but not labels. IGZSRTCD does not allow comment statements, remarks, or labels, and eliminates blank statements.
  • DFSPARM and IGZSRTCD enable you to pass certain DFSORT run-time options (such as MSGDDN) that are ignored in SORTCNTL.
  • Using the COBOL special register SORT-CONTROL enables you to pass different IGZSRTCD data sets to DFSORT when you have multiple SORT statements. The statements in IGZSRTCD are actually placed in the parameter list in storage that COBOL passes when it calls DFSORT. A separate parameter list with the appropriate control statements is passed for each call.
  • SORTCNTL and DFSPARM enable you to pass DFSORT control statements without increasing the storage used for the parameter list.

For our examples, we use SORTCNTL, although IGZSRTCD or DFSPARM would do just as well.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014