Managing MsgId and CorrelId in a unit of work (3270)
The usual style of CICS programming is pseudo-conversational, that is, a series of independent transactions that are linked together to form a complete application.
When using the 3270 bridge, the link between the transactions of a pseudo-conversation is maintained by passing the Facility token and RemoteSysId returned by the first transaction of the sequence into subsequent messages of the conversation
In earlier versions of the CICS bridge the RemoteSysId field was not used; however, it is important that it is now passed thorough the conversation to enable the use of the facility for multiple CICS bridge monitors. .
When using a CICS system prior to CICS TS 2.2, for the first message for each transaction, set the:
- CorrelId to MQCI_NEW_SESSION
- MQCIH.UOWControl to MQCUOWC_ONLY
Figure 1 shows a pseudo conversational 3270 transaction prior to CICS TS 2.2.
Figure 1. Setting of key fields: WebSphere MQ - pseudo-conversational 3270 transaction viewed from the perspective of the bridge prior to CICS TS 2.2
If your transaction is sending and receiving multiple messages, set:
- MQCIH.UOWControl to MQCUOWC_ONLY in the first message, even when a large number of messages are sent by your application
- MQCUOWC_CONTINUE in messages supplying additional data to the transaction
- Correlid to the message identifier generated for the first message of the transaction
If you want to end the transaction that is running, set the value of MQCIHCancelCode to a four-character abend code.
When using CICS TS 2.2 and subsequent releases, we can group the transactions of a pseudo-conversation together within a single bridge session, instead of using separate sessions for each transaction. Doing this reduces the overheads of the bridge monitor and improves performance. However, you can still use the multiple session approach if we need to maintain compatibility with older CICS releases, or if there might be long delays within a pseudo-conversation (for example waits for user input).
To group transactions into a single session, set:
- MQCIH.UOWControl to MQCUOWC_FIRST and the value of Correlid to MQCI_NEW_SESSION for the first message of the bridge session
- MQCIH.UOWControl to MQCUOWC_MIDDLE in subsequent messages of the bridge session, whether they supplying additional data to a transaction or starting a new transaction
- MQCIH.UOWControl to MQCUOW_LAST to indicate a proposed end of session. If the CICS transaction ends with no more requests for data, that is, the reply message type is MQMT_REPLY, the session is ended. If the CICS transaction requests more data, the Msgtype of the reply is MQMT_REQUEST and the next message can be sent with MQCUOWC_LAST or MQCUOWC_CONTINUE.
- If the Msgtype of the reply is MQMT_REQUEST and you do not want to continue the session, send MQCIH.UOWControl = MQCUOWC_COMMIT to end the session. To end a running 3270 transaction set MQCIH.CancelCode to a four-character abend code.
- Correlid to the message identifier generated for the first message of the transaction in all subsequent messages for the bridge session
If you want to end the transaction that is running, set the value of MQCIHCancelCode to a four-character abend code.
If you want to end a session between transactions set MQCIH.UOWControl to MQCUOWC_COMMIT.
The following diagram summarizes the values to use and expect in key fields in the MQMD and MQCIH in typical CICS 3270 bridge applications.
Figure 2 shows a conversational 3270 transaction.
Figure 2. Setting of key fields: WebSphere MQ - conversational 3270 transaction viewed from the perspective of the bridge
Parent topic:
3270 applications
fg15740_