Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 11: CICS Error Handling and Debugging


IGNORE CONDITION

IGNORE CONDITION is the quiet cousin of HANDLE CONDITION. It tells CICS to simply ignore the listed conditions when they occur: no abend, no branch, the program just continues with the next statement. It is useful for conditions you genuinely do not care about, but it must be used with care because it can hide real errors.

What is IGNORE CONDITION

  • Syntax: EXEC CICS IGNORE CONDITION condition ... END-EXEC. You can list several conditions in one statement.
  • When an ignored condition is raised, CICS does nothing at all. Execution continues with the statement after the command.
  • Like HANDLE CONDITION, it stays active for the rest of the task once issued, until you change or cancel it.
  • It applies to exceptional conditions only. It cannot ignore program checks like ASRA or operator purges.

IGNORE CONDITION vs HANDLE CONDITION

  • HANDLE CONDITION branches to your label so you can react. IGNORE CONDITION silently continues.
  • A later HANDLE CONDITION for the same condition replaces the ignore. A later IGNORE CONDITION replaces the handle.
  • To stop ignoring a condition, issue EXEC CICS HANDLE CONDITION condition END-EXEC with no label. The condition will abend the task again if raised.
  • Coding RESP on a command bypasses both HANDLE and IGNORE CONDITION for that command.

Example: ignoring a harmless condition

  • The example below ignores QZERO on a transient-data read used for polling, then restores normal handling:
    PROCEDURE DIVISION. 0000-MAIN. EXEC CICS IGNORE CONDITION QZERO END-EXEC. EXEC CICS READQ TD QUEUE('POLLQ') INTO(POLL-REC) LENGTH(POLL-LEN) END-EXEC. * QZERO (queue empty) is ignored here - empty just means * there is nothing to process right now. IF EIBRESP = DFHRESP(NORMAL) PERFORM 2000-PROCESS-POLL-REC END-IF. * Restore normal handling for later code. EXEC CICS HANDLE CONDITION QZERO END-EXEC.

Using IGNORE CONDITION safely

  • Ignore only conditions whose meaning is fully understood and harmless in that spot, such as QZERO when polling or ENDFILE at a known boundary.
  • Keep the ignore as short-lived as possible: cancel it right after the code that needs it, as shown above.
  • Never use IGNORE CONDITION ERROR as a blanket silencer. It hides every condition and makes debugging nearly impossible.
  • When in doubt, prefer RESP: it records the outcome in a variable you can test, instead of throwing the information away.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant