When a request to start a transaction arrives at a CICS® TOR, the TOR must find out on which system the transaction is to run. It does this by examining the installed transaction definition; in particular, the values of the DYNAMIC and REMOTESYSTEM options. See Defining transactions for transaction routing.
Transaction routing can be either static or dynamic, depending upon the value of the DYNAMIC option.
Static transaction routing occurs when DYNAMIC(NO) is specified in the transaction definition. In this case, the request is routed to the system named in the REMOTESYSTEM option. (If REMOTESYSTEM is unspecified, or if it names the local CICS system, the transaction is a local transaction, and transaction routing is not involved.)
Dynamic routing of terminal-initiated transactions uses the "hub" routing model described in The "hub" model.
Specifying DYNAMIC(YES) means that you want the chance to route the terminal data to an alternative transaction at the time the defined transaction is invoked. CICS manages this by allowing a user-replaceable program, called the dynamic routing program, to intercept the terminal input data and specify that it be redirected to any transaction and system. The default dynamic routing program, supplied with CICS, is named DFHDYP. You can modify the supplied program, or replace it with one that you write yourself. You can also use the DTRPGM system initialization parameter to specify the name of the program that is invoked for dynamic routing, if you want to name your program something other than DFHDYP. For programming information about user-replaceable programs in general, and about DFHDYP in particular, see the CICS Customization Guide. For information about system initialization parameters, see the CICS System Definition Guide.
CICS invokes the dynamic routing program:
If the transaction was initiated from a terminal, the dynamic routing program can route the request.
If the transaction was initiated by an EXEC CICS START command, the routing program may or may not be able to route the request--see Routing transactions invoked by START commands.
Parameters are passed in a communications area between CICS and the dynamic routing program. The program may change some of these parameters to influence subsequent CICS action. The parameters include:
Dynamic transaction routing enables you to make transaction routing decisions based on such factors as input to the transaction, available CICS systems, relative loading of the available systems, and so on. However, a routing program can perform other functions, besides redirecting transaction requests.
Your dynamic routing program could be used to:
A dynamic routing program can issue EXEC CICS commands, but EXEC CICS RECEIVE prevents the routed-to transaction from obtaining the initial terminal data.
For programming information about writing a dynamic transaction routing program, see the CICS Customization Guide.
CICS transactions use many techniques to pass information between one another, and to synchronize activity between themselves. Some of these techniques require the transactions exchanging data to execute in the same CICS region, and therefore impose restrictions on the dynamic routing of the transactions. If you are using dynamic transaction routing for workload balancing purposes (where equivalent transactions reside on multiple systems), your routing program must be aware of transactions that are dependent on each other--that is, that contain affinities--so that it can route them consistently.
If you are planning to create a dynamic transaction routing environment, consisting perhaps of a mixture of CICS Transaction Server for z/OS®, Version 3 Release 1 and earlier systems, you may find the CICS Interdependency Analyzer useful. It can be used to identify the causes of inter-transaction affinities in CICS Transaction Server for z/OS and CICS Transaction Server for OS/390® regions.
For more information about this utility, see the CICS Interdependency Analyzer for z/OS User's Guide and Reference.
For further information about transaction affinities, see the CICS Application Programming Guide.
Normally, to take advantage of dynamic transaction routing, you
have to write a dynamic transaction routing program. However, if you
use the CICSPlex® System Manager (CICSPlex SM) product to
manage your CICSplex, you need not do so. CICSPlex SM provides a dynamic
routing program that supports both workload balancing and workload
separation. All you have to do is to tell CICSPlex SM, through its
user interface, which TORs and AORs in the CICSplex can participate
in dynamic transaction routing, and define any affinities that govern
the AORs to which particular transactions must be routed. The
output from the CICS Interdependency Analyzer can be used directly by CICSPlex SM.
Using CICSPlex SM, you could integrate workload balancing for transactions and DPL requests.
For introductory information about CICSPlex SM, see the CICSPlex SM Concepts and Planning manual.