SAME SORT AREA Clause

The SAME SORT AREA clause optimizes the storage area assignment to a given SORT statement.

The SAME SORT AREA clause is syntax checked, but is treated as documentation.

Read syntax diagramSkip visual syntax diagram
SAME SORT AREA Clause - Format

                                                   .-------------.   
              (1)                                  V             |   
>>-SAME--SORT------+------+--+-----+--file-name-3----file-name-4-+-><
                   '-AREA-'  '-FOR-'                                 

Notes:
  1. Syntax-checked only.
When the SAME SORT AREA clause is specified, at least one file-name specified must be a sort file. Files that are not sort files may also be specified. The following rules apply:
  • More than one SAME SORT AREA clause may be specified. However, a given sort file must not be named in more than one such clause.
  • If a file that is not a sort file is named in both a SAME AREA clause and in one or more SAME SORT AREA clauses, all the files in the SAME AREA clause must also appear in that SAME SORT AREA clause.
  • Files named in a SAME SORT AREA clause need not have the same organization or access.
  • Files named in a SAME SORT AREA clause that are not sort files do not share storage with each other unless the user names them in a SAME RECORD AREA clause.