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

Information specific to Linux 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

Information specific to Windows 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

  1. 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.
  2. Open the project and expand the cobol folder.
  3. 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

  1. On the Application Entry Point page, make sure that COBOL is selected
  2. Ensure that you specify the TEST compiler option in the COBOL settings on the Compile Options page.
  3. 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.
  4. Create an MVS subproject.
  5. Copy the COBOL program from the local project to a COBOL data set in the MVS subproject.
  6. Switch to the Debug perspective if you are not already using it.
  7. Ensure that the debug daemon is listening.
  8. Open the z/OS Projects view.
    To display the z/OS Projects view in the Debug perspective, select Window > Show View > Other, expand z/OS Project Views, select z/OS Projects, and click OK.
  9. Right-click the COBOL file in the subproject.
  10. Select Generate JCL > for Compile Link Go.
  11. Right-click on the generated JCL file.
  12. 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.

What to do next

You might decide after the debug session that you would like to debug this module again. Since the load module is already built, you can right-click the load module and select Debug Application to run another debug session.