# RED CICS Request/Reply

CICS RED provides a server module that a user application can link to the called SXXREQR which provides an immediate synchronous method.

SXXREQR is a reentrant safe thread and an open API, and accessible by multiple transactions concurrent without locking issues.

SXXREQR runs on L8/L9 TCBs and receives parameters from the user application having to do with the following items:

- Message location
- Message size
- Trigger Service to use
- RED Trigger service definition in Substation ES on how to handle message feedback

The flow is as follows:

1. User application sets up message data in the following items:
   1. A Container (Single)
   2. A storage location (it cannot be used for MRO configuration)
   3. CICS DFHCOMMAREA (limited to 32K)
2. User application sets up the SXXREQR parameter information.
   1. The Services ID to use (Substation ES RED Trigger definition)
   2. Type of data (Container, Storage Location or DFHCOMMAREA)
   3. Type of Response (Container, TSQ, CommArea, Data location)
   4. Timeout value
3. User application does CICS LINK to SXXREQR.
4. SXXREQR sends the message immediately to Substation ES. If no Substation ES is available, an error is immediately generated and returned to the caller.
   1. The Substation ES accepts the message, and then sends it to its destination based on the Service definition it has. The message contains a TOKEN (tibss-envelope) that must be added to the response message. The response message along with the token are sent back to Substation ES on the "reply-to" destination.
   2. If Substation ES fails, SXXREQR returns an error condition to the caller.
5. User application reviews a return code and a reason code for any error indication.
6. On normal return (for example, no errors and zero return code), user application uses response data as indicated from Container, TSQ, CommArea, or Data location.

The following figure shows how the Substation RED synchronous transfers:

Copyright © TIBCO Software Inc. All rights reserved.