Controlling how z/OS Debugger handles warnings about invalid data in comparisons

When z/OS® Debugger processes (evaluates) a conditional expression and the data in one of the operands is invalid, the conditional expression becomes invalid. In this situation, z/OS Debugger stops and prompts you for a command. You have to enter the GO command to continue running your program. If you want to prevent z/OS Debugger from prompting you in this situation, enter the SET WARNING OFF command.

A conditional expression can become invalid for several reasons, including the following situations:

  • A variable is not initialized and the data in the variable is not valid for the variable's attributes.
  • A field has multiple definitions, with each definition having different attributes. While the program is running, the type of data in the field changes. When z/OS Debugger evaluates the conditional expression, the data in the variable used in the comparison is not valid for the variable's attributes.

If an exception is raised during the evaluation of a conditional expression and SET WARNING is OFF, z/OS Debugger still stops, displays a message about the exception, and prompts you to enter a command.

The following example describes what happens when you use a field that has multiple definitions, with each definition having different attributes, as part of a conditional expression:

  1. You enter the following command to check the value of WK-TEST-NUM, which is a field with two definitions, one is numeric, the other is string:
    AT CHANGE WK-TEST-NUM 
       BEGIN;
       IF WK-TEST-NUM = 10; 
          LIST 'WK-TEST-NUM IS 10';
       ELSE;
          GO;
       END-IF;
       End;
  2. When z/OS Debugger evaluates the conditional expression WK-TEST-NUM = 10, the type of data in the field WK-TEST-NUM is string. Because the data in the field WK-TEST-NUM is a string and it cannot be compared to 10, the comparison becomes invalid. z/OS Debugger stops and prompts you to enter a command.
  3. You decide you want z/OS Debugger to continue running the program and stop only when the type of data in the field is numeric and matches the 10.
  4. You enter the following command, which adds calls to the SET WARNING OFF and SET WARNING ON commands:
    AT CHANGE WK-TEST-NUM 
       BEGIN;
       SET WARNING OFF;
       IF WK-TEST-NUM = 10; 
          LIST 'WK-TEST-NUM IS 10';
       ELSE;
          BEGIN;
          SET WARNING ON;
          GO;
          END;
       END-IF;
       SET WARNING ON;
       END;

    Now, when the value of the field WK-TEST-NUM is not 10 or it is not a numeric type, z/OS Debugger evaluates the conditional expression WK-TEST-NUM = 10 as false and runs the GO command. z/OS Debugger does not stop and prompt you for a command.

In this example, the display of warning messages about the conditional expression (WK-TEST-NUM = 10) was suppressed by entering the SET WARNING OFF command before the conditional expression was evaluated. After the conditional expression was evaluated, the display of warning messages was allowed by entering the SET WARNING ON command.

Carefully consider when you enter the SET WARNING OFF command because you might suppress the display of warning messages that might help you detect other problems in your program.