The disk size specifies the amount of disk storage in words to be used during the sort operation. If disk size is not specified, the default disk size is used. The default disk size for ALGOL is 600,000 words and for COBOL is 900,000 words.
If disk size is set to 0 and the number of tapes is greater than 0, a tape-only sort occurs.
If disk size is set to 0 and no tapes are specified, SORT operates in memory-only mode.
Normally, SORT allocates 20 disk areas with varying area sizes, depending on your disk estimate.
Disk size significantly affects the speed of disk sorting. If sufficient disk is not made available to contain the output of the merge phase, SORT is unable to merge as many disk strings. Therefore, SORT merges fewer strings, when possible, and attempts to reduce the risk of terminating due to lack of disk space (SORT ERROR #5).
Disk estimates must be large enough to accommodate your input file. The amount of disk space required for merging depends on several factors. Estimating a precise amount of disk space is difficult because of the gaps created by unfilled buffers at the end of strings. However, a safe disk estimate is two times the input file size.
The following method for estimating disk size is suggested:
-
Convert the record size to words. Do not add three additional words as described under “Memory Size” in this section.
-
Multiply the record size (in words) by the number of records to be sorted.
-
Multiply the number obtained by step 2 by one of the following:
-
1.5 to obtain a near minimum estimate.
-
2.25 to obtain a safe estimate.
-
3.5 or more if a restartable sort is to be performed.
-
You can also expand the size of the SORT work file by setting the SORTLIMITS bit of the OPTION task attribute. However, when you use this option, the ability to reuse some of the records at the beginning of the sort work file is lost. Therefore, a sort that can complete successfully without SORTLIMITS being set because it reuses work file records would require a substantial amount of additional work space if you were to run it with SORTLIMITS set. This disk space can be provided either by answering OK to the message “SORT FILE FULL, OK TO EXPAND SORT FILE BY <number>” or by increasing the original sort size specification.