Use TEST to produce object code that enables Debug Tool to perform batch and interactive debugging. With TEST, you can also enable the inclusion of symbolic variables in the formatted dumps produced by Language Environment.
TEST option syntax .-NOTEST----------------------------------------------. >>-+-----------------------------------------------------+----->< '-TEST-+--------------------------------------------+-' | .-HOOK---. .-,NOSEPARATE-. .-,NOEJPD-. | '-(-+--------+-+-------------+-+---------+-)-' '-NOHOOK-' '-,SEPARATE---' '-,EJPD---'
Option default is: NOTEST
Suboption defaults are: HOOK, NOSEPARATE, NOEJPD
Abbreviations are: SEP|NOSEP
You can specify TEST suboptions in any order, and can specify any combination of suboptions (one, two, or all). If you code a left parenthesis after TEST, however, you must code at least one suboption.
The amount of debugging support available depends on which TEST suboptions you use, as explained below. Use NOTEST if you do not want to generate object code that has debugging information and do not require that formatted dumps include symbolic variables.
Hook suboptions (compiled-in versus dynamic hooks)
A path point is any location in a program where the logic flow is not necessarily sequential, or can change. Some examples of path points are IF-THEN-ELSE constructs, PERFORM loops, ON SIZE ERROR phrases, and CALL statements.
Symbolic debugging information suboptions
Information needed to enable symbolic debugging is always generated if the TEST option is in effect.
JUMPTO and GOTO enablement suboptions
The EJPD and NOEJPD suboptions control enablement of the Debug Tool commands JUMPTO and GOTO in production debugging sessions. These suboptions have an effect only if the TEST(NOHOOK) and OPTIMIZE compiler options are specified.
Controlling module size while retaining debugging capability:
If you invoke the COBOL compiler from JCL or TSO and you specify TEST(. . .,SEPARATE,. . .), the symbolic debug information tables are written to the data set that you specify in the SYSDEBUG DD statement. For details about coding that statement and about the SYSDEBUG data set, see the related information below about defining the debug data set and about logical record length and block size.
When you invoke the COBOL compiler from the z/OS UNIX shell and you specify TEST(. . .,SEPARATE,. . .), the symbolic debug information tables are written to file.dbg in the current directory, where file is the name of the COBOL source file.
Performance versus debugging capability:
You can control the amount of debugging capability that you get and so also the program performance, as follows:
When you use the Dynamic Debug facility of Debug Tool (SET DYNDEBUG ON), you can interactively debug your program even if the program has no compiled-in debug hooks.
With TEST(NOHOOK,. . .,NOEJPD), you can also compile using OPTIMIZE (either OPT(STD) or OPT(FULL)) for a more efficient program, but with some restrictions on debugging:
The restrictions above about referring to items discarded by OPT(FULL) and about the AT CALL command also apply when you use this combination of options.
This combination does not run as fast as optimized code, but it provides increased debugging capability. All Debug Tool commands are supported except AT CALL entry-name.
TEST(HOOK) causes the compiler to put compiled-in hooks at every statement, resulting in slower code, but all Debug Tool commands are supported.
Language Environment:
The TEST option specified with any of its suboptions can improve your formatted dumps from Language Environment by adding these two features to the dumps:
With NOTEST, the dump will not have program variables nor the line number of the failing statement.
Enterprise COBOL uses the Language Environment-provided dump services to produce dumps that are consistent in content and format with those that are produced by other Language Environment-conforming member languages.
Whether Language Environment produces a dump for unhandled conditions depends on the setting of the runtime option TERMTHDACT. If you specify TERMTHDACT(DUMP), a dump is generated when a condition of severity 2 or greater goes unhandled.
SEPARATE suboption and Language Environment:
For programs that are compiled using TEST(. . .,SEPARATE,. . .), Language Environment gets the name of the separate debug data set (which is written to ddname SYSDEBUG) from the object program. To change the name of the separate debug data set, use the Language Environment COBOL debug file exit.
related tasks
Defining the debug data set (SYSDEBUG)
Language Environment Debugging Guide (Generating a Language Environment
dump with TERMTHDACT)
Debug Tool User's Guide (Starting Debug Tool by using the TEST runtime
option)
Language Environment Customization (Modifying the COBOL debug file name)
related references
Logical record length and block size
cob2 input and output files
Conflicting compiler options
OPTIMIZE
Language Environment Programming Reference (TEST | NOTEST)