example, if you need to pass information between successive invocations of the
XPCREQ exit, UEPTSTOK provides a means of doing this.
The EIB
Copies of EIBRSRCE, EIBRCODE, EIBRESP, and EIBRESP2 are passed to the
exit, so that you can:
v Modify or set completion or resource information in XPCREQ and XPCREQC.
v Examine completion information in XPCREQC.
You can update the copies of EIBRSRCE, EIBRCODE, EIBRESP and EIBRESP2
that you are given in the parameter list. Program Control copies your values into the
real EIB after the completion of XPCREQC; or if you specify a return code of
‘bypass’ in XPCREQ.
You must set valid program control responses. You must set all three of
EIBRCODE, EIBRESP and EIBRESP2 to a consistent set of values, such as would
be set by Program Control to describe a valid completion. Program Control does
not police the consistency of EIBRCODE, EIBRESP, and EIBRESP2. To aid you
in setting the values of EIBRCODE, EIBRESP, and EIBRESP2, the values used by
Program Control are specified in DFHPCEDS.
Example of how XPCREQ and XPCREQC can be used
XPCREQ and XPCREQC can be used for a variety of purposes. One example of a
possible use is given below.
In this example, XPCREQ and XPCREQC are used to route LINK 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 load balancing function. For the purpose of this
example, it is assumed that a global work area (GWA) already exists, and that it
contains a list of available SYSIDs together with a count of the number of LINK
requests currently being processed by each SYSID.
In XPCREQ:
1. Scan the global work area (GWA) to locate a suitable CICS region - for
example, the region currently processing the least number of LINK 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 UEPPCTOK to the address of the storage obtained.
4. Set PC_ADDR7 to the address of the 4-byte area.
5. If setting PC_ADDR7 now makes it the last address, set the high-order bit in the
address, and unset the high-order bit in what was previously the last address.
6. Set the X'02' existence bit on in PC_BITS1 to indicate that a SYSID is specified.
7. Return to CICS.
In XPCREQC:
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.
program control program exits
164
CICS TS for OS/390: CICS Customization Guide