SAME SORT-MERGE AREA Clause

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

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

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

                    (1)                                   
>>-SAME--SORT-MERGE------+------+--+-----+--file-name-3--------->
                         '-AREA-'  '-FOR-'                

   .-------------.   
   V             |   
>----file-name-4-+---------------------------------------------><

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