Using the IGNORE CONDITION command

Just as you can arrange for control to pass to a particular label for a specific condition with a HANDLE CONDITION command, so you can have the program continue when a specific condition occurs. You do this by setting up an IGNORE CONDITION command to ignore one or more of the conditions that can potentially arise on a command. The IGNORE CONDITION command means that no action is to be taken if a condition occurs; control returns to the instruction following the command and return codes are set in the EIB. The following example ignores the MAPFAIL condition:

  EXEC CICS IGNORE CONDITION MAPFAIL
  END-EXEC.

While a single EXEC CICS® command is being processed, it can raise several conditions.3 CICS checks these and passes back to your application program the first one that is not ignored (by your IGNORE CONDITION command). CICS passes back only one exception condition at a time to your application program.

An IGNORE CONDITION command for a given condition applies only to the program you put it in, and it remains active while the program is running, or until a later HANDLE CONDITION command naming the same condition is met, in which case the IGNORE CONDITION command is overridden.

You can choose an IGNORE CONDITION command if you have a program reading records that are sometimes longer than the space you provided, but you do not consider this an error and do not want anything done about it. You might, therefore, code IGNORE CONDITION LENGERR before issuing READ commands.

You can also use an IGNORE CONDITION ERROR command to catch any condition considered as an error for which there is no currently active HANDLE CONDITION command that includes a label. When an error occurs, control is passed to the next statement and it is up to the program to check for return codes in the EIB. See page How CICS keeps track of what to do for examples of conditions that are not considered as errors.

You can also switch from ignoring a condition to handling it, or to using the system default action. For example, you could code:

*    MIXED ERROR PROCESSING
     EXEC CICS IGNORE CONDITION LENGERR
     END-EXEC.

  ·
  ·
  ·
EXEC CICS HANDLE CONDITION DUPREC(DUPRTN) LENGERR ERROR(ERRHANDL) END-EXEC.

Because this code initially ignores condition LENGERR, nothing happens if the program raises a LENGERR condition; the application simply continues its processing. Of course, if the fact that LENGERR has arisen means that the application cannot sensibly continue, you have a problem.

Later in the code, you can explicitly set condition LENGERR to the system default action by naming it in a HANDLE CONDITION command without a label. When this command has been executed, the program no longer ignores condition LENGERR, and if it subsequently occurs, it now causes the system default action. The point about mixing methods is that you can, and that each condition is treated separately.

You cannot code more than 16 conditions in the same command. You must specify additional conditions in further IGNORE CONDITION commands.


3.
For example, you may have a file control command that is not only invalid but also applies to a file not defined in the file control table.

[[ Contents Previous Page | Next Page Index ]]