FastSort Manual

Using FastSort System Procedures
FastSort Manual429834-003
5-36
SORTMERGESTART Procedure
Before your process can call SORTMERGESTART with the restart flag set to 1,
your process must call SORTMERGESTATISTICS or an error must end the
SORTPROG process.
Each call to SORTMERGESTART must specify the same sort control block.
If you call the SORTBUILDPARM procedure, its restart flag (build-flags.<15>)
must be set to 0 for the first call and to 1 for successive calls.
Each call to SORTBUILDPARM must specify the same sort control block as the
call to SORTMERGESTART.
A call to SORTMERGESTART returns immediately after SORTPROG reads the input
parameters. When your process calls SORTMERGESTART again, SORTPROG
accepts parameters for restart as follows:
If SORTPROG ends abnormally and the restart flag is set to 1, SORTPROG uses
the most recently specified process-start parameters when it restarts.
If SORTPROG exists and the current process-start parameters are different
than when it started, SORTPROG ignores all changes except for a changed priority
value.
The COBOL85 SORT and MERGE statements do not support the restart option.
Alternate Collating Sequence Table
The calling process can read an alternate collating sequence table from a file that the
COLLATEOUT command produced.
Example
The following example shows the SORTMERGESTART procedure with the restart
option:
error := SORTMERGESTART (sortblock,
keyblock,,
sortfiles,,,,
len,,,,,
restart); ! restart.<15> is 0
...
! Call SORTMERGESEND for each record
! Call SORTMERGESEND with length = -1
! Call SORTMERGERECEIVE for each record, until length = -1
errnum := SORTMERGESTATISTICS (sortblock,
statlen,
stats);
! statlen = 21, and stats is an integer array of 21 words.
...
error := SORTMERGESTART (sortblock,
keyblock,,