POP HANDLE
Restores the suspended HANDLE stack. The CICS POP HANDLE statement is used to restore the previous error-handling state that was saved using the PUSH HANDLE statement. It allows the program to remove temporary error handlers and revert to the previously defined error-handling routines.
The POP HANDLE command restores the current effect of the HANDLE CONDITION, IGNORE CONDITION, HANDLE ABEND, and HANDLE AID commands to the before state. All the suspended conditions are restored if a POP HANDLE is coded for a PUSH HANDLE.
Key Features -
- Removes temporary error handlers set up after PUSH HANDLE.
- Restores the previous HANDLE CONDITION or HANDLE ABEND settings.
- Ensures that the program does not retain outdated error-handling logic.
Syntax -
EXEC CICS POP HANDLE
END-EXEC.
This command removes the most recent PUSH HANDLE state, restoring the previous error-handling routines.
Short Examples -
Scenario - Temporary Error Handling for a Specific Operation
...
PROCEDURE DIVISION.
EXEC CICS HANDLE CONDITION
NOTFND(GLOBAL-ERROR-HANDLER)
END-EXEC.
...
EXEC CICS PUSH HANDLE
END-EXEC.
...
EXEC CICS READ
DATASET('CUSTFILE')
INTO(WS-DATA)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP NOT = 0 THEN
...
END-IF.
EXEC CICS POP HANDLE
END-EXEC.
...
The file operation executes, and if an error occurs, it is handled by the local handler. POP HANDLE is used to remove the temporary error handler and restore the global one.
Error Conditions -
Eror Condition | RESP | RESP2 | Reason |
---|---|---|---|
INVREQ | 16 | Occurs if no matching PUSH HANDLE command has been executed at the current link level. |