DataLoader/MX Reference Manual (G06.24+)
Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual—525872-002
5-4
BUILDKEY
The C prototypes are described next. The sexitscb.cob file, described on page 2-1,
contains COBOL models.
BUILDKEY
The BUILDKEY exit is given the input record and builds the key associated with the
record.
The syntax is:
BUILDKEY operates as if the record’s key is the first 255 bytes, or the length of the
record if it is shorter. If your record’s key differs from this, you should replace
BUILDKEY with your own version.
BUILDKEY is called for each record if an output file has the KEYRANGE interpretation,
or if the -P parameter is specified, directing DataLoader/MX to estimate the partition
boundary keys. BUILDKEY can determine the reason it was called by testing the
Purpose parameter. If the Purpose parameter is 0, it has been called for partition
boundary estimation purposes. If it is 1, it has been called because of a write to a file
with the KEYRANGE interpretation. These are the only two reasons BUILDKEY is
called.
The key built by BUILDKEY must be made up of printable characters. If the actual key
has nonprintable characters in it, such as in a binary number, BUILDKEY needs to
convert it to a printable form, such as hex or decimal. This restriction is imposed to
make the creation of keyrange files easier, as well as to make the output readable
when doing partition boundary estimation.
If BUILDKEY returns a Status of 0, this record is skipped. If BUILDKEY returns a
Status greater than 0, the returned key is used for the specified purpose.
If BUILDKEY was called for the purpose of writing to a file with the KEYRANGE
interpretation and the returned Status is -1, the record is written to all keyranges. If
the returned Status is -2, the record is written once, and only once, to each of the
files mentioned in the keyrange file.
CHECKARG
The CHECKARG exit is called if DataLoader/MX is given a parameter that is not
recognized by DataLoader/MX itself.
void BUILDKEY( short* Purpose,
char* Record,
long* RecordLen,
char* KeyBuf,
long* KeyBufLen,
long* KeyLen,
short* Status)