Debug the Db2 application with generated JCL

Learn how to debug the application by using the JCL generated during the previous module.

About this task

The JCL that is generated from the Generate JCL > For Compile Link Go action creates a batch job to run the application. Because you selected Run in batch with debugger, the JCL is generated with an extra inline Assembler CSECT, which is linked into the application. This CSECT, called CEEUOPT, contains Language Environment® runtime options. These runtime options cause the program to be run in the debugger at each invocation.

Procedure

To debug the application by using the generated JCL, do these steps:

  1. Select Window (on Windows) or IBM® Developer for z/OS® (on macOS) > Perspective > Open Perspective > Other.
  2. In the Open Perspective window.
    1. Select Debug.
    2. Click OK.
  3. In the Debug view, check that the debug daemon is listening.
    If the Debug toolbar shows the icon Debug daemon not listening icon, then the daemon is not listening. Select Start listening on port from the menu to start the debug daemon.
  4. Switch back to z/OS Projects perspective.
  5. In the Remote Systems view,
    1. Right-click the generated JCL file.
      A menu opens.
    2. Select Submit from the menu.
      If you receive JCL errors, fix these errors and resubmit the JCL file. If there were no JCL errors, a debug session begins.
  6. Set a breakpoint on the GOBACK statement.
  7. Press F8 to run to that breakpoint.
  8. Look in the Variables view and expand the plus sign on FRIENDZRECORD.
    The following variables are displayed:
    Db2 variables in Debug perspective
  9. Run the program to completion.