When a terminal operator enters a transaction code, and CICS® determines that the transaction is in a remote system, a local relay transaction is attached to execute a CICS-supplied program known as the relay program. The relay program provides the communication mechanism between the terminal and the remote transaction. Note that in CICS on Open Systems, the relay is a function running in a shared library.
Although CICS determines the program to be associated with the relay transaction, the user’s definition for the remote transaction determines the other attributes of the relay transaction. These are usually those of the "real" transaction in the remote system.
When the relay transaction is attached, it acquires an intersystem session and sends a request to the application-owning system, to cause the "real" user transaction to be started. In the application-owning system, the terminal is represented by a control block known as the surrogate TCTTE (in CICS on Open Systems, terminal surrogate). This TCTTE becomes the transaction’s principal facility, and is indistinguishable by the transaction from a "real" terminal entry. If the transaction issues a request to its principal facility, the request is shipped back to the relay transaction over the intersystem session. The relay transaction then issues the request or output to the terminal. In a similar way, terminal status and input are shipped through the relay transaction to the user transaction.
Automatic transaction initiation is handled in a similar way. If a transaction that is initiated by ATI requires a terminal that is connected to another system, a request to start the relay transaction is sent to the terminal-owning system. When the terminal is free, the relay transaction is connected to it.
The relay transaction remains in existence for the life of the user transaction and has exclusive use of the session to the remote system during this period. When the user’s transaction terminates, an indication is sent to the relay transaction, which terminates and frees the terminal and the intersystem session.