Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


FASTSRT requirements for sort input and output files

If you specify FASTSRT but your code does not meet FASTSRT requirements, the compiler issues a message and the COBOL run time performs the I/O instead. Your program will not experience the performance improvements that are otherwise possible.

To use FASTSRT, you must describe and process the input files to the sort and the output files from the sort in these ways:

If you code a RELATIVE KEY clause for an output file, it will not be set by the sort.

Performance tip: If you block your input and output records, the sort performance could be significantly improved.

QSAM requirements

  • QSAM files must have a record format of fixed, variable, or spanned.
  • A QSAM input file can be empty.
  • To use the same QSAM file for both input and output, you must describe the file using two different DD statements. For example, in the FILE-CONTROL SECTION you might code this:
    SELECT FILE-IN ASSIGN INPUTF.
    SELECT FILE-OUT ASSIGN OUTPUTF.

    In the DATA DIVISION, you would have an FD entry for both FILE-IN and FILE-OUT, where FILE-IN and FILE-OUT are identical except for their names.

    In the PROCEDURE DIVISION, your SORT statement could look like this:

    SORT file-name
      ASCENDING KEY data-name-1
      USING FILE-IN GIVING FILE-OUT

    Then in your JCL, assuming that data set INOUT has been cataloged, you would code:

    //INPUTF  DD DSN=INOUT,DISP=SHR
    //OUTPUTF DD DSN=INOUT,DISP=SHR

    On the other hand, if you code the same file-name in the USING and GIVING phrases, or assign the input and output files 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. If the file was found to be ineligible for FASTSRT on input, it might be eligible for FASTSRT on output.

A QSAM file that qualifies for FASTSRT can be accessed by the COBOL program while the SORT statement is being performed. For example, if the file is used for FASTSRT on input, you can access it in an output procedure; if it is used for FASTSRT on output, you can access it in an input procedure.

VSAM requirements

  • A VSAM input file must not be empty.
  • VSAM files cannot be password-protected.
  • You cannot name the same VSAM file in both the USING and GIVING phrases.
  • A VSAM file that qualifies for FASTSRT cannot be accessed by the COBOL program until the SORT statement processing is completed. For example, if the file qualifies for FASTSRT on input, you cannot access it in an output procedure and vice versa. (If you do so, OPEN fails.)

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)