Transaction failures

When a transaction fails, you can invoke CICS® facilities during and after the abend process.

These facilities include:
  • CICS condition handling
  • HANDLE ABEND commands, and user exit code
  • The SYNCPOINT ROLLBACK command
  • Dynamic transaction backout (DTB)
  • Transaction restart after DTB
  • The program error program (DFHPEP)

You can use these facilities individually or together. During the internal design phase, specify which facilities to use and determine what additional (application or systems) programming might be involved.

The RESP option on a command returns a condition ID that can be tested. Alternatively, a HANDLE CONDITION command is used in the local context of a transaction program to name a label where control is passed if certain conditions occur.

For example, if file input and output errors occur (where the default action is merely to abend the task), you might want to inform the master terminal operator, who can decide to terminate CICS , especially if one of the files is critical to the application.

Your installation might have standards relating to the use of RESP options or HANDLE CONDITION commands. Review these for each new application.

HANDLE ABEND commands

A HANDLE ABEND command can pass control to a routine within a transaction, or to a separately compiled program when the task abends.

The kind of things you might do in abend-handling code include:
  • Capturing diagnostic information (in addition to that provided by CICS ) before the task abends, and sending messages to the master terminal and user
  • Executing clean up actions, such as canceling start requests (if the PROTECT option has not been used)
  • Writing journal records to reverse the effects of explicit journaling performed before the abend.

Your installation might have standards relating to the use of HANDLE ABEND commands; review these for each new application.

EXEC CICS SYNCPOINT ROLLBACK command

ROLLBACK might be useful within your transaction if, for instance, the transaction discovers logically inconsistent input after some database updates have been initiated, but before they are committed by the syncpoint.
Before deciding to use it, however, consider the following:
  • Rollback backs out updates to recoverable resources performed in the current unit of work only and not in the task as a whole.
  • The SYNCPOINT command, with or without the ROLLBACK option, causes a new unit of work to start.
  • If you have a transaction abend, and you do not want the transaction to continue processing, issue an EXEC CICS ABEND and allow dynamic transaction backout to back out the updates and ensure data integrity. Use rollback only if you want the application to regain control after nullifying the effects of a unit of work.

    For programming information about the SYNCPOINT command, see SYNCPOINT.

Dynamic transaction backout

Dynamic transaction backout (DTB) occurs automatically for all transactions that have recoverable resources. It is not an option you can specify on a transaction resource definition. The actions of DTB are described under Transaction backout.

Remember that:
  • For transactions that access a recoverable resource, DTB helps to preserve logical data integrity.
  • Resources that are to be updated should be made recoverable.
  • DTB takes place only after program level abend exits (if any) have attempted clean up or logical recovery.

Transaction restart after DTB

For each transaction where DTB is specified, consider also specifying automatic transaction restart. For example, for transactions that access DL/I databases (and are subject to program isolation deadlock), automatic transaction restart is usually specified.

Even if transaction restart is specified, a task will restart automatically only under certain default conditions (listed under Abnormal termination of a task ). These conditions can be changed, if absolutely necessary, by modifying the restart program DFHREST.

Use of the program error program (DFHPEP)

Decide whether or not to include your own functions, examples of which are given in The CICS-supplied PEP . (DFHPEP is invoked during abnormal task termination as described at Abnormal termination of a task .)



dfht2c00201.html | Timestamp icon Last updated: Monday, 5 June 2017