IMPROVING SORT PERFORMANCE WITH FASTSRT - IBM Mainframe

Using the FASTSRT compiler option improves the performance of most sort operations. With FASTSRT, the DFSORT product performs the I/O on input and/or output files named in either or both of the following statements:

  • SORT... USING
  • SORT... GIVING

You may not use the DFSORT program product options of SORTIN and SORTOUT if you specify FASTSRT. FASTSRT allows DFSORT to perform the I/O. Performance of the sort operation may be significantly improved if you block your input and output records. If file status is specified, it will be ignored during the sort.

FASTSRT Requirements for JCL

  • In the run-time JCL, the sort work files (SORTWK nn files) are assigned to a direct-access device.
  • The DCB-parameter of the DD statement in run-time JCL must match the FD description for the input/output file.

FASTSRT Requirements for Input and Output Files

  • QSAM files must have a record format of fixed, variable, or spanned.
  • VSAM files cannot be password protected.
  • Any RELATIVE KEY specified for an output file will not be set by the sort.
  • No INPUT declarative (for input files), OUTPUT declarative (for output files), or any file-specific declaratives (for either input or output files) can be specified that apply to FDs used in the sort.
  • The same VSAM file cannot be named in both the USING and GIVING phrases.
  • A VSAM file will not qualify for FASTSRT (either for the USING or the GIVING clause) if more than one file was specified on the opposing (USING or GIVING) phrase.
  • The same QSAM file can be used for both FASTSRT input and output, but must be described by two different DD statements at run time. For example, if FASTSRT is in effect, in the FILE-CONTROL Section you might have:

FASTSRT Requirements for Input and Output Files

  • In the Data Division, then, you would have a FD for both FILE-IN and FILE-OUT, where FILE-IN and FILE-OUT are identical, except for their names (they describe the same file). In the Procedure Division, your SORT statement would look like this:

FASTSRT Requirements for Input and Output Files

Where data set INOUT has been cataloged.

  • If the input and output QSAM files are the same, either because the same filename was specified for the USING and GIVING phrases, or because the input and output files are assigned the same DDNAME, then the file can be accepted for FASTSRT either for input or output, but not both. If no other conditions disqualify the file from being eligible for FASTSRT on input, then the file will be accepted for FASTSRT on input, but not on output. However, if the file was found to be ineligible for FASTSRT on input, it may be eligible for FASTSRT on output.
  • A VSAM file that qualifies for FASTSRT- either in the USING or the GIVING phrase) cannot be accessed by the COBOL program until the SORT statement processing has completed. That is, if a VSAM file qualifies for FASTSRT on input (USING phrase), it cannot be accessed (OPEN will fail) in the output procedure and vice versa.
  • A QSAM file that qualifies for FASTSRT (either in the USING or the GIVING phrase) can be accessed by the COBOL program during the execution of the SORT statement. That is, if it is used for FASTSRT on input, it can be accessed by the COBOL program in the output procedure; if it is used for FASTSRT on output, it can be accessed in the input procedure.
  • A variable relative file is ineligible to be either the input or output file for FASTSRT.
  • The record descriptions of the SD and FD (for either the input or the output file) must both specify the same format, either fixed or variable, and the largest records of the SD and FD (for either the input file or the output file) must specify the same record length. In addition, input files and output files must meet specific requirements.

FASTSRT Requirements for Input Files

  • Only one file can be mentioned in the USING phrase.
  • A VSAM file used as input must not be empty. However, a QSAM input file may be empty.
  • No input procedure can be used.

FASTSRT Requirements for Output Files

  • Only one file can be mentioned in the GIVING phrase.
  • The LINAGE clause must not be specified for the output FD entry.
  • No output procedure can be used.

Information Messages for FASTSRT

The compiler issues information messages to point out statements in which FASTSRT can improve performance. The compiler also issues messages if you specified FASTSRT, but do not qualify for improved sort performance in your program.

If the requirements for FASTSRT listed above are not met, COBOL will perform all the I/O, and there will be no performance improvement, even though you specified FASTSRT.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics