FastSort Manual

Using FastSort System Procedures
FastSort Manual429834-003
5-35
SORTMERGESTART Procedure
You can use only one sort key field, and the data type for the field must be BINARY
UNSIGNED.
The sort key field must be the same as the file's primary key field.
You must specify ascending in the key-block array.
You can specify the dslack and islack parameters for an existing key-sequenced
output file.
Existing Output Files
If out-file-name exists on a disk prior to the sort or merge run, SORTPROG purges
all the data in the file before reusing it. For SORTPROG to reuse an existing disk file
as an output file, all of the following cases must be true:
The existing file type must be the same as the output file type in effect for the run.
The existing file size must be equal to or greater than the sum of the all the input
file sizes, except when you specify the NOPURGE option (flags.<5> set to 1).
The maximum record length for the existing file must be equal to or greater than
the maximum output record length for the run.
If any of these is not true, SORTPROG purges the existing output file and creates a
new file. If you do not want FastSort to purge and recreate the file, set flags.<5> to 1.
Record Count
The value of in-file-count need not be the exact number of records in the input
file. However, you should round up and not down if you round off the number of
records.
If you underestimate the number of input records, SORTPROG might underestimate
the size needed for the scratch or output file, which can cause FastSort error 29 or 30.
For more information on error messages, see Appendix B, FastSort Error Messages
.
Extended Memory Size
For more information, see Controlling Extended Memory on page 2-11.
Restart Option
This option enables the same SORTPROG process to be used for successive sort or
merge runs. The requirements for using the restart option are:
Set the restart flag (flags.<15>) to 0 for the first call to SORTMERGESTART and
to 1 for successive calls.
Caution. If you specify the same file as both an input file and output file for a sort run, you can
lose all the data from the input file if an error or processor failure terminates the SORTPROG
process.