DataLoader/MX Reference Manual (G06.24+)
Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual—525872-002
5-35
Sorting With DTLSort
Upon return from this end of input call, DTLSort is ready to return the records in sorted
order. Each call to DTLSort returns the next record in the memory pointed to by Buf,
and the int pointed to by Len is set to the length of the record.
After all records have been returned, the next call causes DTLSort to set the int
pointed to by Len to -1, indicating that all sorted records have been returned. This call
also sets the memory pointed to by Buf to information about the sort. This information
is in a 44-byte structure so, for this reason, the memory pointed to by Buf when
retrieving sorted records should be at least 44 bytes long.
Upon return from this end of output call, DTLSort is again in the uninitialized state, and
the whole sequence can be repeated if another sort is to be done.
If errors occur, DTLSort generates an appropriate error message and terminates.
DTLSort uses FastSort to do the sorting, so you can control how DTLSort works by
using the FastSort DEFINEs described in the FastSort Manual. Use DEFINEs when
sorting large amounts of data and to request parallel sorting.
The format of the key description that must be passed on the first call to DTLSort is:
key-desc [, key-desc ]... [ (UPS nnn) ]
key-desc is:
direction field-desc [ type ]
direction is:
{ ASC }
{ ASCENDING }
{ DESC }
{ DESCENDING }
field-desc is:
{ startcol:endcol }
{ startcol for length }
type is:
{ STRING }
{ UPPER }
{ INTEGER }
{ REAL }
{ UNSIGNED }
{ SLE }
{ SIGNED LEADING EMBEDDED }
{ SLS }
{ SIGNED LEADING SEPARATE }
{ STE }
{ SIGNED TRAILING EMBEDDED }
{ STS }
{ SIGNED TRAILING SEPARATE }