Apply exit: Developing

A sample apply exit is provided in SCACSAMP member CECSAX01. The sample code performs the following functions:

  • Sets the version value of the apply exit during the initialization call.
  • Uses CICS macros for working storage; your exit might choose to allocate an area with another mechanism and save its address in the user words of the apply exit parameter list.
  • Sets exit codes for odd key values so those keys are not applied to the target VSAM data set.

The sample member CECSAX01 is written in non-LE assembly language. Sample JCL for assembling and linking the CECSAX01 is located in USERSAMP member CECCJAX1.

The apply exit must be written as a threadsafe load module. The apply exit is invoked by Data Replication for VSAM CICS transactions on an open TCB in the CICS Open Transaction Environment (OTE). The apply exit should expect to receive control in TCB-mode, problem state, key 8, primary ASC mode (that is, not AR-mode). The CECCUTIL program makes initialization, verification and termination calls. The CECCWRTR program can make any function code calls except verification.

The apply exit is invoked with OS linkage. A single parameter is passed as an address to an area that contains the parameter list for the apply exit. The member SCACMAC(CECMAPEX) describes the structure of the apply exit parameter list.

Registers on entry to exit

R0 Unpredictable
R1 Address of standard parameter list (31 bit)
R2-R12 Unpredictable
R13 Address of a 72-byte save area
R14 Return address
R15 Exit entry point address

Registers on exit from exit

R0 Unpredictable
R1-R13 Unchanged from time of entry
R14 Return address
R15 Unpredictable

On entry to the apply exit, R1 will contain a 31-bit address of a standard parameter list. This points to a single parameter, which is the address of the apply exit parameter list.

The apply exit must not execute any CICS API calls that are not threadsafe and must not violate any CICS OTE restrictions. Within these restrictions, the apply exit is free to do whatever processing you deem necessary. However, the apply exit is expected to release any acquired resources that might lead to storage leaks or contention.

CICS PPT entries are not required for apply exit load modules. The apply exit load module must be in the STEPLIB concatenation of the CICS region.

Data Replication for VSAM will establish no ESTAE or recovery routines around the apply exit. This behavior is to avoid performance issues and because an abend in the apply exit will end the CICS transaction. Data Replication for VSAM will, in turn, end replication for the subscription and attempt to restart another utility or writer within configured writer thread limits.

Example

A VSAM cluster is being replicated and you want to create a condensed representation of the data by not applying the updates if the key value falls outside a given range. By default, Data Replication for VSAM replicates all keys to the target. An apply exit can be used to instruct Data Replication for VSAM to not apply certain changes at the target. The sample exit SCACSAMP(CECSAX01) simulates this type of processing by flagging odd keys so the target data set is not updated.