Debugging a sample COBOL program
Use these instructions to debug a sample COBOL program that is included with IBM Developer for z/OS locally and on the z/OS® system in batch mode.
About this task
Remote debugging does not support the following functions on the Linux® platform: bidirectional enablement, workstation-based debugging, local
COBOL or PL/I builds, local preprocessors for PL/I files, local syntax check of
PL/I files, or show dependencies for PL/I files.
Debugging setup
Set up your workspace for debugging.
About this task
Local COBOL and PL/I builds that use the native
COBOL and PL/I compilers are supported only on Windows
platforms and in the Developer for the Enterprise edition of the product.
Procedure
- Create a sample project for COBOL debugging. See Creating a sample project for step-by-step instructions. Select COBOL as the example category and COBOL Sample 2 as the example.
- Open the project and expand the cobol folder.
- Right-click the project name, then click Rebuild Project to build the project and generate a load module.
Remote debugging
Follow these steps for remote debugging.
Procedure
- On the Application Entry Point page, make sure that COBOL is selected
- Ensure that you specify the TEST compiler option in the COBOL settings on the Compile Options page.
- Select Run in the Debugger on the Runtime
Options page. If you are working with an existing system definition, you can edit the system properties to match these characteristics. Select the existing system definition, and then right-click and select Properties.
- Create an MVS subproject.
- Copy the COBOL program from the local project to a COBOL data set in the MVS subproject.
- Switch to the Debug perspective if you are not already using it.
- Ensure that the debug daemon is listening.
- Open the z/OS Projects view. To display the z/OS Projects view in the Debug perspective, select , expand z/OS Project Views, select z/OS Projects, and click OK.
- Right-click the COBOL file in the subproject.
- Select .
- Right-click on the generated JCL file.
- Click Submit or press
Ctrl+Alt+M. The compilation builds an object deck, the link builds a load module, and the Go step starts a debug session.