DataLoader/MX Reference Manual (G06.24+)
Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual—525872-002
5-34
Sorting With DTLSort
Field
is a value from 1 through 10 that specifies the field to which the column is to be
added.
Coln
is the variable that holds the result.
Lenn
is the maximum number of characters that can be placed in Coln.
Specify a Col and Len pair for each column in the result. DataLoader/MX moves a
maximum of Lenn bytes to its corresponding Coln column.
For a field with n columns added through DTLCartAddCol, use
DTLCARTGENERATEnCOLFIELDCOB.
Sorting With DTLSort
This procedure provides a very simple interface for sorting.
The syntax is:
Initially DTLSort is in the unintialized state. On the first call, Buf must point to a
null-terminated string describing the key fields, and Len must point to the length of the
longest record that will be sorted.
Upon return from this initialization call, DTLSort is ready to take the records to be
sorted. It is called once for each input record where Buf points to the record, and Len
points to the length of that record.
When all input records have been given to DTLSort, it is called once more with Len
pointing to a -1 to indicate that all records have been input. The contents of Buf are
irrelevant on this call.
short DTLCARTGENERATE4COLFIELDCOB ( short field,
char* Col1, short Len1,
char* Col2, short Len2,
char* Col3, short Len3,
char* Col4, short Len4);
short DTLCARTGENERATE5COLFIELDCOB ( short field,
char* Col1, short Len1,
char* Col2, short Len2,
char* Col3, short Len3,
char* Col4, short Len4,
char* Col5, short Len5);
void DTLSort( char* Buf, int* Len );