Example of how XICEREQ and XICEREQC can be used

In this example, XICEREQ and XICEREQC are used to route START requests to a number of different CICS® regions to provide a simple load balancing mechanism. The example shows only the capabilities of the exits; it is not intended to indicate an ideal way of achieving the function.

In XICEREQ:
  1. Scan the global work area (GWA) to locate a suitable CICS region (for example, the region currently processing the least number of START requests).
  2. Having decided which system to route the request to, increment the use count for this system.
  3. Obtain a 4-byte area in which to store the SYSID for this request. This can be allocated from the GWA to avoid issuing a GETMAIN. If the area is obtained by issuing a GETMAIN, set UEPICTOK to the address of the storage obtained.
  4. Set IC_ADDR7 to be the address of the 4-byte area so that XICEREQC can also use this area.
  5. If setting IC_ADDR7 now makes it the last address, set the high-order bit in the address, and reset the high-order bit in what was previously the last address.
  6. Set the X'02' existence bit on in IC_BITS1 to indicate that a SYSID is specified.
  7. Return to CICS.
In XICEREQC:
  1. Scan the global work area (GWA) and locate the entry for the CICS region specified in the SYSID parameter.
  2. Decrement the use count for this system.
  3. If a GETMAIN was issued in XICEREQ to obtain an area to hold the SYSID, issue a FREEMAIN for the address held in UEPICTOK.
  4. Return to CICS.

Example and sample programs

CICS supplies two programs for use at the XICEREQ exit:
  • DFH$XTSE, supplied as a softcopy listing only (not as a source code file), is an example program that shows how to modify fields in the command-level parameter structure passed to all the EXEC interface exits.
  • DFH$ICCN is a sample program for use in a distributed routing environment, where you want to cancel a previously-issued interval control request but have no way of knowing to which region to direct the CANCEL. For examples of situations which DFH$ICCN is designed to cope with, see Canceling interval control requests.