XDTAD user exit
XDTAD is invoked for each record that is added to the source data set after initial loading. You can choose whether to add the record to the data table or not. This user exit cannot modify the records because, as the records are written by the application, it is assumed that they are already in the format used in the data table.
- For a user-maintained data table, the user exit is invoked once—before the record is added to the data table.
- For a CICS®-maintained data table, the user exit is invoked twice—before the record is added to the source data set and then again before the record is added to the data table.
The record written by the application is passed as a parameter to the user exit program—see fields UEPDTRA and UEPDTRL. This program can choose (depending on the key value, for example—see fields UEPDTKA and UEPDTKL) whether to include the record in the data table or not. This decision is indicated by setting the return code.
Depending on the return code value, the following action is taken by CICS:
| Return code | Action |
|---|---|
| UERCDTAC | Add the record to the data table. This is the default if the exit is not activated. |
| UERCDTRJ | Do not add the record to the data table. |
The XDTAD exit must not modify the data in the record. If you used XDTRD to truncate the data records when the user-maintained data table was loaded, you must code your application so that it only tries to write records of the correct format for the data table.
Sample XDTAD exit program: DFH$DTAD
DFH$DTAD is a sample XDTAD global user exit program. It demonstrates the use of the XDTAD user exit for shared data tables. The sample program is provided in the SDFHSAMP library.