The USRX0000 member in the ASM data set contains a sample application illustrating the use of the user exits feature. The USERMODB member in the JCL data set contains JCL to install this sample application. The sample application implements all the user exits with the exception of the REDOLOG-2 Exit.
The Initialization exit (USRX0000) obtains a working storage area (mapped by WORKSPAC DSECT) for use by all the other supplied exits, initializes it, and stores its address in field UXSPACE@ of the User Exit Parameter list. It then sets up the addresses of all the other supplied user exits in the User Exit Parameter list, sets default values in the working storage area and attaches a subtask to perform the OPEN, CLOSE, and OFFLOAD functions (refer to
SYSOTCB Subtask).
The Cache Complete exit checks to see if an offload of captured intents is in progress. If it is, Cache Complete waits for the SYSOTCB subtask to signal that it is complete. Then, if a spin of the output data set is required, it posts the SYSOTCB subtask to close the current output data set, and then it posts the SYSOTCB subtask again to allocate and open a new output data set.
The Checkpoint Start exit checks to see if any captured intents are to be off-loaded. If they are, it posts the SYSOTCB task to start the offload process and sets a flag to indicate to the Cache Complete exit that an offload is in progress.
The File Management Checkpoint exit swaps the intent‑list collection buffers, if required, and sets pointers for the checkpoint user exits to offload captured intent lists. Checks are made to see if any activity such as a spin is required and if so, sets flags to control the checkpoint user exits accordingly.
This exit checks that the value supplied for ZSTORE does not exceed the number of transactions per checkpoint. If it does, it is reset to the number of transactions per checkpoint. Storage is obtained for two buffers capable of holding intents for the number of intents specified by ZSTORE and various pointers are initialized in the common working storage.
The Open user exit checks to see if there is a value for ZDDNAME. If none is supplied, all the exits are disabled by turning on the high‑order bits in their addresses in the User Exit Parameter list. If a value is supplied, the SYSOTCB subtask is posted to open the first output data set.
The Recovery user exit captures any intents matching the selection criteria in one of the buffers obtained by the Initialization Complete exit and marks them as recovered intents. A check is made to stop these intents from overflowing the available storage. This should happen only if the parameter values were changed since the Data Object Broker shut down abnormally (for a normal shut down no intents would be recovered) or if monitoring is being done on initialization of a different table name than at the time of the failure.
The REDOLOG-1 user exits captures intents matching the selection criteria in one of the buffers obtained by the Initialization Complete exit and marks them as normal intents. If a checkpoint is required due to the current buffer being full or any other activity such as a spin being requested, it schedules this by setting the appropriate return code.
Because of the restriction of the operating system that data sets must be opened and closed by the same task, a subtask is attached by the Initialization exit. It also performs the formatting and writing of any captured intent lists to the output data set, so that this process can overlap the writing of Cache data set by CHPTTASK.
The subtask initializes and then waits for one of the user exits to post it to perform a function. When the function is complete, the subtask posts an ECB to release the waiting user exit. The following functions are implemented:
The sample output shows an intent list captured from an application that clears parameter set P1,P2,P3,P4 from table EXIT_SAMPLE and then inserts a number of rows into this table. This table is defined as shown in
Sample Table Definition. The implemented user parameters are set as follows: