FastSort Manual

Sorting Programmatically
FastSort Manual429834-003
4-5
Sending Records to Be Sorted
Sending Records to Be Sorted
To use SORTMERGESEND for a sort run, you must specify the following values in the
call to SORTMERGESTART:
1 for the num-sort-files parameter
Blanks for the input-file-name parameter
Sending Records to Be Merged
To use SORTMERGESEND for a merge run, you must specify the following in the call
to SORTMERGESTART:
A number from 2 to 32 for the num-merge-files parameter
From 2 to 32 names of all blanks for the input-file-name parameter
SORTPROG can merge multiple sets of records sent from a calling process. In this
operation, the term input stream refers to a source of sorted records for merging. The
number of input streams for merging is the number of merge files you specify in the call
to SORTMERGESTART. SORTPROG merges the sorted records from all input
streams into a single set of output records.
You can send records from the input streams to SORTPROG through
SORTMERGESEND. The first call to SORTMERGESEND transmits a record from
stream 0. Then SORTPROG returns a number in the stream-id parameter of
SORTMERGESEND to indicate the input stream from which the next record should
come. After SORTMERGESEND transmits all records from the input streams,
SORTPROG merges the records and returns them to the calling process or produces
the output file.
Record blocking is valid only for sort runs. If you try to use record blocking with merge
runs, SORTPROG returns error 81 (BLOCKED INTERFACE NOT ALLOWED WITH
MERGE).
Figure 4-2
on page 4-6 shows how SORTPROG accepts input records from an
application process.