SET WARNING command (C, C++, COBOL, and PL/I)

Controls display of the z/OS® Debugger warning messages and whether exceptions are reflected to the C, C++, and PL/I programs. For COBOL programs, controls the ability to modify variables while you debug optimized code. The initial setting is ON.

Read syntax diagramSkip visual syntax diagramSETWARNINGONOFF;
ON
Displays the z/OS Debugger warning messages, and conditions such as a divide check result in a diagnostic message. For COBOL programs, prohibits the modification of variables while you debug optimized programs.
OFF
Suppresses the z/OS Debugger warning messages, and conditions raise an exception in the program. For COBOL programs, allows the modification of variables while you debug optimized programs.

Exceptions that occur due to interaction with you are likely to be due to typing errors and are probably not intended to be passed to the application program. However, you might want to raise a real exception in the program, for example, to test some error recovery code. (TRIGGER is not always appropriate for this because it does not set up the exception information.)

Usage notes

  • You can control whether the GOTO or JUMPTO commands are used by executing SET WARNING OFF for the following programs:
    • A COBOL program compiled without hooks being inserted by the compiler and with optimization, if you compiled with the NOEJPD suboptions of the TEST compiler option
    • A program compiled with Enterprise COBOL for z/OS Version 5 or later and optimized by Automatic Binary Optimizer for z/OS
    • A program compiled with Open XL C/C++ for z/OS
    This functionality is provided with a strong warning, so be aware that the use of GOTO or JUMPTO might cause abends in this configuration. When you use GOTO or JUMPTO with a program that is compiled by using OPT and TEST(NOEJPD), any type of failures cannot be investigated by IBM® service.

    For example, if you get an abend on a GOTO command when debugging a COBOL program that is compiled with OPT and TEST(NOEJPD), you might want to try the same GOTO in a program compiled with OPT and TEST(EJPD). When a program is compiled with OPT and TEST(NOEJPD) , failures or abends caused by GOTO or JUMPTO commands are not investigated by IBM Service.

    You can get the best behavior of GOTO and JUMPTO in programs compiled with OPT and TEST(NOEJPD) if any one of the following conditions is true:

    • The target of the GOTO or JUMPTO command is a paragraph name or a section name (label).
    • The target of the GOTO or JUMPTO command is the first statement in the paragraph or section.

    These statements are targets of COBOL statements PERFORM or GOTO in the COBOL program.

    To get GOTO and JUMPTO behavior that is fully supported, you must compile programs with NOOPT and TEST, or with OPT and TEST(EJPD). However, these programs do not run as fast as programs compiled with OPT and TEST(NOEJPD).

  • After applying the z/OS Debugger PTF for APAR PM75819 and the COBOL runtime PTF for APAR PM80361, you can control whether the GOTO or JUMPTO commands can be used when debugging a COBOL program that is compiled with the OPTIMIZE option and the TEST(NOHOOK, NOEJPD) or TEST(NONE) option. In those cases, the compiler has not enabled GOTO and JUMPTO, but if SET WARNING OFF is used, you can use the GOTO and JUMPTO commands.

    This functionality is provided with a strong warning, so be aware that the use of GOTO or JUMPTO might cause abends in this configuration. When you use GOTO or JUMPTO with a program that is compiled by using OPT and TEST(NOEJPD) or TEST(NONE) options, any type of failures cannot be reviewed by IBM service.

    For example, if you get an abend on a GOTO command when debugging a COBOL program that is compiled with OPT and TEST(NOEJPD), you might want to try the same GOTO in a program compiled with OPT and TEST(EJPD). When a program is compiled with OPT and TEST(NOEJPD) or TEST(NONE) options, failures or abends caused by GOTO or JUMPTO commands are not investigated by IBM Service.

    Without the PTF changes referenced above, GOTO and JUMPTO commands are disabled for COBOL programs that are compiled with OPT and TEST(NOEJPD) or TEST(NONE), regardless of the SET WARNING setting used.

    With the PTF changes referenced above, you can compile your code for maximum performance and use the GOTO and JUMPTO commands when SET WARNING OFF is set to ON. However, the results of using the commands might be unpredictable. You can get the best behavior of GOTO and JUMPTO in programs compiled with OPT and TEST(NOEJPD) or TEST(NONE) if any one of the following conditions is true:
    • The target of the GOTO or JUMPTO command is a paragraph name or a section name (label).
    • The target of the GOTO or JUMPTO command is the first statement in the paragraph or section.
    • These procedures are targets of COBOL statements PERFORM or GOTO in the COBOL program.

    To get GOTO and JUMPTO behavior that is fully supported, you must compile programs with NOOPT and TEST, or with OPT and TEST(EJPD). However, these programs do not run as fast as programs compiled with OPT and TEST(NOEJPD).

  • You can use this command in remote debug mode.
  • z/OS Debugger detects C conditions such as the following:
    • Division by zero
    • Array subscript out of bounds for defined arrays
    • Assignment of an integer value to a variable of enumeration data type where the integer value does not correspond to an integer value of one of the enumeration constants of the enumeration data type.
  • z/OS Debugger detects the following PL/I computational conditions:
    • Invalid decimal data
    • CHARACTER to BIT conversion errors
    • Division by zero
    • Invalid length in varying strings
  • You can modify variables in an optimized program that was compiled with one the following compilers:
    • Enterprise COBOL for z/OS, Version 4.1
    • Enterprise COBOL for z/OS and OS/390®, Version 3 Release 2 or later
    • Enterprise COBOL for z/OS and OS/390, Version 3 Release 1 with APAR PQ63235 installed
    • COBOL for OS/390 & VM, Version 2 Release 2
    • COBOL for OS/390 & VM, Version 2 Release 1 with APAR PQ63234 installed
    However, results might be unpredictable. To obtain more predictable results, compile your program with Enterprise COBOL for z/OS, Version 4.1, and specify the EJPD suboption of the TEST compiler option. However, variables that are declared with the VALUE clause to initialize them cannot be modified.
  • When z/OS Debugger evaluates a conditional expression (for example, the condition of the WHEN clause of the AT CHANGE command) and the conditional expression is invalid, then z/OS Debugger does one of the following actions:
    • If SET WARNING is set to ON, z/OS Debugger stops and displays a message that it could not evaluate the conditional expression. You need to enter a command to indicate what action you want z/OS Debugger to take.
    • If SET WARNING is set to OFF, z/OS Debugger does not stop nor display a message that it could not evaluate the conditional expression. z/OS Debugger continues running the program.

Example

Specify that conditions result in a diagnostic message.
SET WARNING ON;

Refer to the following topics for more information related to the material discussed in this topic.