DataLoader/MX Reference Manual (G06.24+)
Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual—525872-002
5-6
DELETEIT
DELETEIT 
The DELETEIT exit is called when you explicitly request it by specifying the letter d or 
D in the list of user exits called through the -X parameter. Its function is to attempt to 
delete a row from the database. 
The syntax is:
If the deletion is successful, DELETEIT should return a positive value. If the deletion is 
not successful, it should return a negative value. If the record should not be processed 
any more by DataLoader/MX, DELETEIT should return a 0 (zero) value.
To make it easier to collect statistics on row deletions, call the DTLDeletedResult utility 
procedure immediately after the execution of the embedded SQL delete. This utility:
•
Checks SQLSTATE
•
Updates DataLoader/MX internal statistics
•
Returns a value appropriate for the Status returned from DELETEIT
For this reason, all DELETEIT user exits should follow this format:
DONEWITHTRANSACTION 
The DONEWITHTRANSACTION exit is called only if you specify the -T parameter just 
before DataLoader/MX commits the current transaction. 
The syntax is: 
Use this exit and its associated exit NEWTRANSACTION to enable the use of SQL 
cursors together with TMF protection. All work done with a cursor must be done under 
the same transaction under which the cursor was opened. For example, you cannot 
open a cursor at the beginning of a job, do a number of transactions, and close the 
cursor at the end of the job. You must close the cursor at the end of each transaction 
and reopen it (specifying the next set of data to be processed) at the beginning of the 
next one. Use DONEWITHTRANSACTION and NEWTRANSACTION to close open 
cursors and open new cursors.
void DELETEIT( char*Rec, long* RecLen, short* Status )
void DELETEIT( char*Rec, long* RecLen, short* Status )
{
...
EXEC SQL delete ..... ;
*Status = DTLDeletedResult( sqlstate );
}
void DONEWITHTRANSACTION( void )










