COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

PERFORM retrieves the merge-file records by executing implicit RETURN statements. When
the implicit PERFORM statement finishes executing, control returns to the merge operation.
If the MERGE statement has a GIVING phrase, the output phase transfers the merged records
to one or more merge-out files. When the MERGE statement begins execution, each
merge-out file must be closed but not locked. The output phase uses implicit OPEN statements
to open each merge-out file in OUTPUT mode. Then the output phase executes implicit
RETURN statements to retrieve records from the merge file and implicit WRITE statements to
release them to the merge-out files. Finally, the output phase uses implicit CLOSE statements
to close the merge-out files.
Regardless of whether the MERGE statement has an OUTPUT PROCEDURE phrase or a GIVING
phrase, the merge operation uses an implicit CLOSE statement to close merge-file after
the output phase ends. Then the MERGE statement terminates execution.
The implicit OPEN and CLOSE statements are equivalent to OPEN and CLOSE statements
without optional phrases.
How the Scratch File Is Determined
NOTE: If a scratch file is specified but its value is all spaces, assume that no scratch file was
specified.
If COBOL_SET_SORT_PARAM_TEXT_ specifies a SCRATCH-FILE, then that file is the scratch
file.
If the SELECT statement associated with merge-file specifies the =_SORT_DEFAULTS
DEFINE as the define-name-literal, then:
If the =_SORT_DEFAULTS DEFINE exists and specifies a scratch file, then that file is the
scratch file.
If the =_SORT_DEFAULTS DEFINE exists but does not specify a scratch file, then a
temporary file on the volume $SYSTEM is the scratch file.
If no =_SORT_DEFAULTS DEFINE exists, then a temporary file on the volume $SYSTEM
is the scratch file.
For more information on the =_SORT_DEFAULTS DEFINE, see Establishing Parameters
With =_SORT_DEFAULTS DEFINE (page 611).
If the SELECT statement associated with merge-file does not specify the
=_SORT_DEFAULTS DEFINE as the define-name-literal, then the file that the SELECT
statement specifies is the scratch file.
How the Volume of the Swap File Is Determined
NOTE: If a swap file is specified but its value is all spaces, assume that no swap file was
specified.
The operating system assigns a swap file to swap pages in and out of memory while the
compiler is running. The swap file mirrors all of the data areas that the compiler uses. The
ideal swap file is a fast device that is neither busy nor mirrored. To redirect the swap file, give
define-name-literal the value =_SORT_DEFAULTS.
366 Procedure Division Verbs