Processing outstanding traffic
In IMS, transaction processing is independent of session status; that is, if a message is received and successfully queued, it is always processed.
However, the way in which IMS handles subsequent replies and continues processing conversations depends on the type of message, the type of error that occurs, and whether the IMS subsystem fails.
- The session is bound between-brackets when it is reinitiated.
- IMS always sends or resends asynchronous replies or unsolicited asynchronous output after successful session restart.
- IMS sends or resends queued
asynchronous replies resulting from
/DISPLAY
,/RDISPLAY
, and/FORMAT
commands. - If the IMS asynchronous transaction abends during the session outage, IMS sends an error message using ATTACH SYSMSG, because exception responses are no longer possible.
- If response mode or conversational output is pending, the session is bound with IMS in-brackets/SEND to permit the pending reply to be sent or re-sent.
- When in conversation mode and input is required, IMS attempts to bind in-brackets/
RECEIVE
. CICS negotiates this bind to a between-brackets state, causing IMS to terminate the conversation, discard the output message, and invoke the Conversational Abnormal Termination exit routine. This exit routine can invoke user processing to schedule an IMS transaction to back out any database changes resulting from previous conversational processing based on the contents of the SPA.When a session is reestablished and sent to between-brackets as described in the preceding paragraph, if the IMS transaction has not yet completed processing the conversational or response mode input (that is, output is not yet available), IMS terminates the session with a message to the master terminal operator requesting that the session be reinitiated (when output is available). This occurs because IMS cannot terminate the in-process transaction as required by the between-brackets bind.
- Except as mentioned, IMS cancels any commands received at the point of failure and discards pending synchronous reply messages that result from an IMS command.
- If the IMS synchronous transaction abends during the session outage, IMS sends an error message using ATTACH SYSMSG, because exception responses are no longer possible.
- After an emergency restart, IMS discards a pending reply message resulting from a nonrecoverable transaction.
- After IMS receives and enqueues an input transaction, session protocols or failures cannot cancel that transaction.
- After a reply message to a CICS synchronous transaction (response mode or conversation) is enqueued, it indicates that the results of all previous IMS processing have been committed. These updates are not backed out even if the reply message is discarded.
If a CICS transaction must
be re-sent to IMS as determined
by STSN
processing, the CICS application, rather than the CICS subsystem itself, must make this determination
and either reconstruct the transaction or request that it be reentered.
After a session fails, CICS cannot
reestablish the environment in which the original transaction was
executing. That is, the connection to the terminal that originally
entered the transaction no longer exists. Further, the transaction
has abnormally terminated; therefore, it is necessary for the CICS application programmer to
define a restart transaction
to be invoked by CICS to handle any IMS output
that CICS might receive on
the restarted session. When this transaction is invoked, the session,
rather than the terminal, is now the primary facility. This transaction
must in turn invoke an asynchronous transaction to acquire the terminal
if output exists that needs to be sent to it.
The transaction code of the restart transaction to be invoked is
carried in the DPN field of the function management header that is
sent to CICS with the input
message. This transaction code is the one specified in the RPROCESS
field of the BUILD ATTACH
command sent by CICS with the outbound message.
This becomes the RDPN parameter automatically wrapped by IMS to the DPN field, which IMS sends on the outbound FMH unless modified
by the IMS MFS.
The ID of the terminal to which CICS is
to send any output reply is found in the PRN field of the incoming
function management header. This is the value specified in the RRESOURCE
field of the BUILD ATTACH
sent by CICS with the outbound message. This becomes
the RPRN parameter automatically wrapped by IMS to the PRN field of the outbound FMH unless
modified by MFS. This value is used as the TERMID
of
the asynchronous transaction scheduled (START
) by
the restart transaction to acquire the terminal.
The restart transaction issues a RETRIEVE
carrying
both TRANSID
and TERMID
fields.
When the transaction specified by the TRANSID
is
initiated, it owns the terminal specified by the TERMID
as
its principal facility.