COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-56
FILE-CONTROL Paragraph
Usage Considerations:
•
Different Devices for Files
The sort-merge file is a temporary file used by a SORT or MERGE statement.
Programs that define their sort-merge file on a different device than the input or
output file of the SORT or MERGE statement must run more efficiently than those
defining input or output files on the same device as the sort-merge file.
•
Redirecting the Swap File
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.
In Example 6-8, a file-control entry assigns a sort file to a temporary file on the
default volume established at run time.
If you want the temporary file on a different volume than the default, do not use
#TEMP. The phrase
ASSIGN TO "$FLAG"
assigns a temporary file on $FLAG, regardless of the current default volume.
Example 6-8. File-Control Entry for Sort-Merge File
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SORT-FILE ASSIGN TO "#TEMP".
...
DATA DIVISION.
FILE SECTION.
SD SORT-FILE
RECORD CONTAINS 40 CHARACTERS.
01 SORT-FIELDS.
...