SET WARNING command (C, C++, COBOL, and PL/I)
Controls display of the Debug Tool 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.
.-ON--. >>-SET--WARNING--+-----+--;------------------------------------>< '-OFF-'
- ON
- Displays the Debug Tool 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 Debug Tool 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
For Enterprise COBOL for z/OS® Version 5, you can control whether the GOTO or JUMPTO commands can be used when debugging a COBOL V5 program that is compiled with the OPTIMIZE option and the TEST(NOEJPD) option by executing SET WARNING OFF. 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 Debug Tool 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.
- Debug Tool 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.
- Debug Tool 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
- When Debug Tool evaluates
a conditional expression (for example, the condition of
the WHEN clause of the AT CHANGE command)
and the conditional expression is invalid, then Debug Tool does
one of the following actions:
- If SET WARNING is set to ON, Debug Tool 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 Debug Tool to take.
- If SET WARNING is set to OFF, Debug Tool does not stop nor display a message that it could not evaluate the conditional expression. Debug Tool continues running the program.
Example
SET WARNING ON;
Refer to the following topics for more information related to the material discussed in this topic.
- Related tasks
- "Controlling Debug Tool when a comparison is invalid" in the Debug Tool User's Guide
- Related references
- Debug Tool commands supported in remote debug mode