DataLoader/MX Reference Manual (G06.24+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual525872-002
5-3
User Exit Descriptions
In the case of “Continue with next exit,” if this is the last exit, the record is passed to
the post-process step. The post process step includes partition boundary estimation (if
-P is specified) and might include writing the record to the output file (if -O= is
specified).
In the case of “Read next record” (0 return status from any of these exits, or negative
return status from exits 1, 2, 3, 4, or C), processing of the current record is stopped
immediately. Remaining user exits are skipped, and the post-process step is skipped.
If user exits that have already run write to the -O file (user call to DTLWrite with -2 as
the file number), that data remains in the -O file.
User Code “H” for Heuristic
It is not unusual for tables to start out empty or, at various stages, have rows added to
them or to have their rows updated. DataLoader/MX can accommodate these
scenarios if you run it with the parameter -X=IU, which always tries an INSERT first, or
-X=UI, which always tries an UPDATE first. However, when the table is mostly empty,
it is most efficient to attempt an INSERT first, and when the table is mostly full, it is
most efficient to attempt an UPDATE first.
While it would be possible to run DataLoader/MX with -X=IU during the first part of the
table’s life and -X=UI during the last part, a better solution is available: -X=H. The letter
H stands for heuristic and it is a combination of I and U. It directs DataLoader/MX to
monitor whether an insert or update was successful for the last 100 records. (100 is the
default but can be overridden by specifying the new value following the letter H, as in
-X=H300.) When DataLoader/MX processes the next record, it first attempts the action
(either insert or update) that has been most successful for those records.
User Exit Descriptions
The interfaces to user exits are designed so that your code can be written in C or
COBOL. Exits have uppercase names, they accept all parameters by reference, and if
they return a value indicating how they functioned, it is returned in a parameter named
Status.
C CONVERTIT Continue with next
exit.
Dump record to -E
file. Read next record.
Read next record.
D DELETEIT Go to post-processing. Continue with next
exit.
Read next record.
I INSERTIT Go to post-processing. Continue with next
exit.
Read next record.
U UPDATEIT Go to post-processing. Continue with next
exit.
Read next record.
Hnnn INSERTIT/
UPDATEIT
Go to post-processing. Continue with next
exit.
Read next record.
Table 5-2. Parameter -X Exit Codes (page2of2)