This topic describes the combination of TEST compiler option and suboptions you need to specify to obtain the wanted debugging scenario. This topic assumes you are compiling your COBOL program with Enterprise COBOL for z/OS®, Version 3.4, or later; however, the topics provide information about alternatives to use for older versions of the COBOL compiler.
The COBOL compiler provides the TEST compiler option and its suboptions to control the following actions:
The following instructions help you choose the combination of TEST compiler suboptions that provide the functionality you need to debug your program:
If you are using other other IBM® Application Delivery Foundation for z Systems™ tools, review the information in IBM Application Delivery Foundation for z Systems Common Components Customization Guide and User Guide to make sure you specify all the compiler options you need to create the files needed by all the IBM Application Delivery Foundation for z Systems tools.
If you are using other IBM Application Delivery Foundation for z Systems tools, review the information in IBM Application Delivery Foundation for z Systems Common Components Customization Guide and User Guide to make sure you specify all the compiler options you need to create the files needed by all the IBM Application Delivery Foundation for z Systems tools.
If you are using other IBM Application Delivery Foundation for z Systems tools, review the information in IBM Application Delivery Foundation for z Systems Common Components Customization Guide and User Guide to make sure that you specify all the compiler options that you need to create the files needed by all the IBM Application Delivery Foundation for z Systems tools.
For Enterprise COBOL for z/OS Version 6 Release 2 with APAR PH04485 installed, you can
specify TEST(SEPARATE(DSNAME),SOURCE) to store the separate debug file name, which is the SYSDEBUG
DD data set name, in the object program.
If you need to debug programs that are loaded
into protected storage, you must verify that your site installed the Authorized Debug Facility.
With the TEST(SEPARATE,SOURCE) compiler option, the debug data is
saved in a separate debug file. The compiler uses the SYSDEBUG DD statement to specify
the separate debug file.If you use an EQAUEDAT user exit, SET DEFAULT LISTINGS command, EQADEBUG DD name, or EQA_DBG_SYSDEBUG environment variable, specify a PDS data set or z/OS UNIX System Services directory as the separate debug file location.
If you use a SET DEFAULT LISTINGS command, EQADEBUG DD name, or EQA_DBG_SYSDEBUG environment variable, and if the separate debug file is not found because the file name does not match the CU name, z/OS Debugger will do an exhaustive search of the data sets specified by the same method to locate the matching debug file. The exhaustive search might be slow.

In addition, you must link your program with the Language Environment SCEELKED library and not the VS COBOL II COB2LIB library.
After you have chosen the compiler options and suboptions, see Planning your debug session to determine the next task you must complete.
Refer to the following topics for more information related to the material discussed in this topic.
The following table explains the effects of the NOTEST compiler option, the TEST compiler option, and some of the suboptions of the TEST compiler option on z/OS Debugger behavior or the availability of features, which are not described in Enterprise COBOL for z/OS Programming Guide:
| Name of compiler option or suboption | Description of the effect |
|---|---|
| NOTEST |
|
| NONE and NOHOOK |
|
| EJPD | You can modify variables in an optimized
program that was compiled with one the following compilers:
|
| NOSYM |
If you are compiling with Enterprise COBOL for z/OS, Version 4, the compiler ignores SYM or NOSYM and always creates a symbol table. This option is not available with Enterprise COBOL for z/OS Version 5. |
| STMT |
If you are compiling with Enterprise COBOL for z/OS, Version 4, the compiler treats the STMT suboption as if it were the HOOK suboption, which is equivalent to the ALL suboption for any release of Enterprise COBOL for z/OS and OS/390, Version 3, or COBOL for OS/390 & VM, Version 2. This option is not available with Enterprise COBOL for z/OS Version 5. |
| PATH |
If you are compiling with Enterprise COBOL for z/OS, Version 4, the compiler treats the PATH suboption as if it were the HOOK suboption, which is equivalent to the ALL suboption for any release of Enterprise COBOL for z/OS and OS/390, Version 3, or COBOL for OS/390 & VM, Version 2. This option is not available with Enterprise COBOL for z/OS Version 5. |
| BLOCK |
If you are compiling with Enterprise COBOL for z/OS, Version 4, the compiler treats the BLOCK suboption as if it were the HOOK suboption, which is equivalent to the ALL suboption for any release of Enterprise COBOL for z/OS and OS/390, Version 3, or COBOL for OS/390 & VM, Version 2. This option is not available with Enterprise COBOL for z/OS Version 5. |
| ALL |
If you are compiling with Enterprise COBOL for z/OS, Version 4, the compiler treats the ALL suboption as if it were the HOOK suboption, which is equivalent to the ALL suboption for any release of Enterprise COBOL for z/OS and OS/390, Version 3, or COBOL for OS/390 & VM, Version 2. This option is not available with Enterprise COBOL for z/OS Version 5, but when you specify the TEST compile with this compiler, it creates an object similar to specifying ALL with the exception that compiled-in hooks are not available. |