FastSort Manual

Using FastSort System Procedures
FastSort Manual429834-003
5-15
SORTMERGESEND Procedure
The sequence number as a 32-bit (4-byte) integer (permutation sort)
The key-field values strung together (key sort)
The sequence number followed by the key-field values strung together
(permutation and key sort)
Receiving Output Records in Extended Memory
You can receive output records from SORTPROG in an extended data segment (which
must be in use at the time of the call). If you want SORTMERGERECEIVE to return a
record to a location in extended memory (which must be mapped), use the
record-loc-ext parameter instead of record-loc to specify the address.
Deblocking Records to Reduce Interprocess Messages
You can specify a single or double buffer for record blocking and deblocking in a call to
SORTBUILDPARM. SORTMERGESTART provides the buffer for FastSort to transfer a
block of records (instead of a single record) in each interprocess message to or from
SORTPROG. Each call to SORTMERGERECEIVE returns a record from this buffer.
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).
Example
This example specifies RECLOC to receive the output record and LENGTH to receive
the number of bytes in the record returned:
receive^status := SORTMERGERECEIVE (sortblock,
recloc,
length);
SORTMERGESEND Procedure
Use SORTMERGESEND to provide input records from the calling process directly to
the SORTPROG process. Use SORTMERGESEND if you omit the in-file-name
parameter from the call to SORTMERGESTART or if in-file-name equals all
blanks.
{ status := } SORTMERGESEND ( ctlblock ! i
{ CALL } ,[ record-loc ] ! i
,length ! i
,[ stream-id ] ! o
,[ spare1 ] ! reserved
,[ spare2 ] ) ! reserved
,[ record-loc-ext ] ! i