Changing The Program Name; Telling Cics Whether To Route Or Terminate A Transaction - IBM SC34-6814-04 Customization Manual

Cics transaction server for z/os
Table of Contents

Advertisement

Important
To route a transaction defined by the DTRTRAN definition, your dynamic routing
program must set the DYRDTRRJ field of the communications area to 'N' (the
default is 'Y'). If you leave DYTDTRRJ set to 'Y', the transaction is rejected.
You can test the DYRDTRXN field to check if the transaction passed to your routing
program is defined by the DTRTRAN definition. Figure 58 contains skeleton code
for routing transactions defined by DTRTRAN.
if DYRDTRXN='Y' then
do
Call Find_AOR(sysid)
if rc=0 then
do
DYRRETC=RETCOD0
DYRSYSID=sysid
DYRDTRRJ='N'
...
end
else
...
end
Figure 58. Example pseudocode to route transactions defined by DTRTRAN

Changing the program name

For transactions defined as DYNAMIC, on invocation of the routing program the
DYRLPROG field in the communications area contains the name of the initial
program associated with the transaction to be routed. If you decide to route the
transaction locally, you can use this field to specify an alternative program to be
run. For example, if all remote CICS regions are unavailable and the transaction
cannot be routed, you may want to run a program in the local CICS terminal-owning
region to send an appropriate message to the user.

Telling CICS whether to route or terminate a transaction

When the routing program is invoked for routing, it can choose whether the
transaction should be routed or terminated. If you want the transaction 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 (or the returned SYSID is blank) CICS executes the
v If the two SYSIDs are not the same, CICS routes the transaction to the remote
If you want to terminate the transaction with a message or an abend, set a return
code of X'8' (or any other non-zero return code other than X'4').
If you want to terminate the transaction without issuing a message or abend, set a
return code of X'4'.
Warning: Setting a return code of X'4' for APPC transaction routing leads to
Returning a value in DYRRETC has no effect when the routing program is invoked
for notification or at termination of the transaction.
/* Is DYP invoked because of DTRTRAN */
/* .. Yes
/*
Select the SYSID of the AOR
/*
Is AOR available?
/*
.. Yes
/*
Set OK Return Code
/*
Set the sysid
/*
Don't reject DTRTRAN defns */
/*
Set other commarea fields
/*
/*
.. No
/*
AOR unavailable logic
/*
transaction locally.
CICS region, using the remote transaction name.
unpredictable results, and should be avoided.
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Chapter 17. Writing a dynamic routing program
593

Advertisement

Table of Contents
loading

Table of Contents