# CICS Transactions Using RED

This section describes the way the Substation ES interfaces with a CICS using the RED environment to run programs and functions in a CICS address space.

Note: The CICS address space and the Substation ES address space do not have to be on the same LPAR.

More than one Substation ES RED interface can communicate with a CICS address space. The Substation ES RED interfaces can be in the same or different Substation ES address spaces on the same or different LPARs.

Listener transactions in CICS, run by default under the #RED transaction and might execute concurrently. The number of concurrent #RED transactions is controlled by a Substation ES start-up parameter in the RED interface called CICS-MAIN-MAX. The value for this keyword dictates the maximum number of #RED transactions that are started.

As messages queue in the RED that might create a backlog, additional #RED transactions are started up to the Substation ES configuration maximum "CMSG-WORKERS" value. Once the backlog of messages in the RED is reduced, #RED transactions terminate and only two #RED transactions remain active.

Note: There must always be one #RED transaction for the system to function correctly.

Substation ES Interface for RED connects to CICS using EXCI and starts a RED listener for messages from Substation ES to perform appropriate recipe functions. The #RED transaction and program SXCO#RED run on a L8 TCB, so you must have sufficient L8 TCB resources to run the requests from Substation ES.

The functions performed by Substation ES recipes are listed as follows:

1. Method of Invocation 2 (DPL) and Method of Invocation 9 (DPL MRO)

   SXCO#RED sets up a CICS CommArea and issues LINK to the Recipe Resource program. Because SXCO#RED is doing a link, the program runs under the Userid (and security) that started #RED. (Most often, this is Substation ES by way of the program SXCOREDA).

   The values for `Remote Region Execution` are used so that the link can be a MRO function to another CICS Region. Also, if `Mirror Transaction` is set, SXCO#RED changes the `eibtrnid` value to match. However, the original transaction ID is #RED. Because #RED is not terminating the transaction, each LINK has the same CICS task ID. SXCO#RED does a "CICS SYNCPOINT COMMIT or ROLLBACK" after each LINK to a user program. Also, SXCO#RED monitors memory being held by the task. When that memory goes over 100,000 bytes, SXCO#RED recycles itself to reduce memory issues

2. Method of Invocation 4 (Task)

   SXCO#RED sets up a CICS CommArea and issues START to the Recipe Resource transaction ID. START uses the Userid and `Remote Region Execution` System Name if specified on the recipe. SXCO#RED does not check CICS max task or SOS, so you must be careful not to flood a CICS region. It would be advisable to set a transaction class up for transactions that would cause a very high concurrency usage.

3. Method of Invocation 10 (Container)

   Both Single and Multi-Container can be used for both LINK and START. LINK uses the values for `Remote Region Execution` if they are present. START uses USERID and `Remote Region Execution` System Name if they are specified on the recipe.

All Methods of Reply are supported:

- 0 for no reply
- 1 for status only
- 2 for reply message
- 3 for reply status and message

Note:

- For START Method of Invocation, the response is from #RED (not the application), Business Responses from a "START" MOI must be done through the RED TRIGGER processing.
- All RED transactions run in reliable mode. When LINK or START is completed, a SYNCHPOINT is issued.

Note:

There will be a rollback issued:

- If an error occurs on send response back to Substation ES.
- If for a guaranteed recipe, Substation ES can publish the response.

Copyright © TIBCO Software Inc. All rights reserved.