Changing the target CICS region
The DYRSYSID field of the communications area passed to the distributed routing
program initially contains the system identifier (sysid) of the default target region to
which the request is to be routed. This is derived from the value of the
REMOTESYSTEM option of the installed transaction definition on the routing
region. If REMOTESYSTEM is not specified, the sysid passed is that of the local
CICS region.
When it is invoked for route selection, the distributed routing program can change
the target region by changing the value in DYRSYSID.
If the specified sysid is invalid, or cannot be found, SYSIDERR is returned to the
distributed routing program—which may deal with the error by returning a different
sysid—see “If an error occurs in route selection” on page 644.
If the routing program changes the sysid when it is invoked for notification, routing
complete, transaction initiation, transaction termination, or abend, the change has
no effect.
Telling CICS whether to route the request
When the routing program is invoked for routing, if you want the request to be
routed (whether you have changed any values or not) return a zero value to CICS
in field DYRRETC of the communications area. When you return control to CICS
with return code zero, CICS first compares the returned sysid with its own local
sysid:
v If the sysids are the same CICS executes the request locally.
v If the two sysids are not the same, CICS routes the request to the remote CICS
region.
If you want CICS to reject the request, return a non-zero value.
Returning a value in DYRRETC has no effect when the routing program is invoked
for notification, routing complete, transaction initiation, transaction termination, or
abend.
Route selection
Notification
Route selection error
Routing attempt complete
Requesting/routing region
Transaction initiation
Transaction termination
Transaction abend
Target region
Figure 64. When and where the distributed routing program is invoked
Chapter 18. Writing a distributed routing program 643