Processing of ADEXIT

The ADEXIT module is called for each SYSADATA record immediately after the record has been written out to the file.

To use an ADEXIT module, you must compile using the ADATA option to produce SYSADATA output, and code the SYSADATA DD statement.

Table 1. ADEXIT processing
Action by compiler Action by exit module
Loads the exit module (mod4) during initialization  
Calls the exit module with an OPEN operation code (op code) Prepares its output destination for processing. Passes the status of the OPEN request to the compiler.
Calls the exit module with a PUT op code when the compiler has written a SYSADATA record, supplying the address and length of the SYSADATA record Passes the status of the PUT request to the compiler by a return code
Calls the exit module with a CLOSE op code when the end-of-data is presented Releases any resources

ADEXIT parameters

The compiler uses 10 parameters, passed by reference, to communicate with the exit module. The return code, data length, and data buffer parameters are set by the exit module for return to the compiler; the other items are passed from the compiler to the exit module.

Table 2. ADEXIT parameters
Parameter number Parameter item Description of item
1 User-exit type Halfword that identifies which user exit is to perform the operation.

4=ADEXIT

2 Operation code Halfword that indicates the type of operation:
  • 0=OPEN
  • 1=CLOSE
  • 3=PUT
3 Return code Fullword, set by the exit module, that indicates the success of the requested operation:
  • 0=Operation was successful
  • 12=Operation failed
4 User-exit work area Six-fullword work area provided by the compiler for use by the user-exit module.

Fourth word: for use by ADEXIT

5 Data length Fullword that specifies the length of the record being supplied by the PUT operation
6 Data buffer or str4 Fullword that contains the address of the data buffer where the compiler has placed the record to be printed by the PUT operation.

str4 applies only to OPEN. The first halfword (on a halfword boundary) contains the length of the string, followed by the string.

7 Not used (Used only by LIBEXIT and MSGEXIT)
8 Not used (Used only by LIBEXIT)
9 Not used (Used only by LIBEXIT)
10 Not used (Used only by LIBEXIT)

Related references  
ADATA