Figure 75 shows the first of only two HANDLE CONDITION commands used in program ACCT01:
PROCEDURE DIVISION.
*
* INITIALIZE.
* TRAP ANY UNEXPECTED ERRORS.
EXEC CICS HANDLE CONDITION
ERROR(OTHER-ERRORS)
END-EXEC.
*
It passes control to the paragraph at label OTHER-ERRORS if any condition arises for a command that does not specify NOHANDLE or RESP.
The HANDLE CONDITION ERROR command is the first command executed in the procedure division of this COBOL program. This is because a HANDLE CONDITION command must be processed before any CICS® command is processed that can raise the condition being handled. Note, however, that your program does not see the effects when it processes the HANDLE CONDITION command; it only sees them later, if and when it issues a CICS command that actually raises one of the named conditions.
In this, and the other ACCT programs, you generally use the RESP option. All the commands specifying the RESP option have been written with a "catch-all" test (IF RESPONSE NOT = DFHRESP(NORMAL) GO TO OTHER-ERRORS) after any explicit tests for specific conditions So any exceptions, other than those you might particularly "expect", take control to the paragraph at OTHER-ERRORS in each program. Those relatively few commands that do not have RESP on them take control to exactly the same place if they result in any condition other than NORMAL because of this HANDLE CONDITION ERROR command.
[[ Contents Previous Page | Next Page Index ]]