Coding CICS applications for restart
When a failure occurs on an ISC session as a result of session or subsystem failure, session restart and resynchronization can be attempted.
If session resynchronization (STSN processing)
is unsuccessful and the session cannot be restarted without intervention,
the master terminal operators of both subsystems are notified. This
situation can require that the terminal user also be notified of the
session's status and of any actions that must be taken, such
as reentering the failing transaction or waiting until corrective
action is taken by the MTO.
After an ISC transaction defined as recoverable is received and
logged by IMS, it can be recovered
across session and subsystem failures. After restart, when the session
has been recovered, if IMS has
pending output, it is sent as follows:
- When IMS sends output on
the same session as that on which the input message is received, that
output message is sent with the same type of headers as those originally
sent with the input. Thus, a reply to a message sent with
SEND/RECEIVEorSEND LASTis returned with the ATTACH FM header and a reply to a message sent withSTART/RETRIEVEis returned with the ATTACH and SCHEDULER FM headers. - When IMS sends output on a session other than that on which the input message is received, that output message is considered as unsolicited output and is sent asynchronously (with ATTACH SCHEDULER).
After a restart, when IMS sends
an output message, CICS® reads
the input message and initiates a transaction.
- Within the application, the EXEC
ASSIGN STARTCODEparameter is examined to determine whether this transaction had been initiated synchronously or asynchronously. - If the restart transaction is initiated asynchronously:
- A
RETRIEVEis issued to obtain the ISC reply. The EIB indicators should be saved. CICS attaches the end-user's terminal to this CICS program as the principal facility. This permits the IMS output to be issued directly to the terminal using a CICS EXECSENDcommand. - The EIB indicators, saved after
RETRIEVEexecution, must be tested to determine whetherSYNCPOINTorRETURNcan be issued to end this transaction.
- A
- If the transaction is initiated synchronously by
SEND/RECEIVEor asynchronously bySEND LAST:- The input message is obtained using
RECEIVE. In this case, the session is now the principal facility. Therefore, theRECEIVEcommand does not require specification of theSESSIONparameter. - After the
RECEIVE, the CICS application saves and then checks the EIB fieldsEIBSYNC,EIBFREE, andEIBRECV, in that order. - The application now issues an
EXTRACT ATTACHto determine the format of the input data and the ID of the terminal that originally submitted the transaction. - The restart logic must now
STARTan additional CICS transaction to acquire the end user's terminal as the principal facility. TheSTARTrequest is made with the terminal ID found in the PRN field by using theEXTRACT ATTACHas theTERMIDparameter on theSTART. - The EIB indicators are now tested to determine whether a sync
point is required and whether the session can be freed. If this can
be done, the application can issue a
RETURNcommand to implicitly cause a sync point to be issued and the session to be freed.
- The input message is obtained using
Within the context of the restart transaction, data can be retrieved for inquiry purposes or databases and files can be updated.
In addition to the foregoing logic, a CICS restart transaction can contain logic to:
- Store input received from the originating terminal on temporary storage. If it is necessary to re-create an input transaction, this information can be obtained and re-sent to IMS.
- Create logic to inform the terminal user of any special processing to be performed, such as reentering a transaction or waiting for some master terminal operator action before proceeding.