Debug JCLDEMO

The IDE enables you to debug a job running on an enterprise server, either locally or remotely.

It is not possible to debug the JCL file itself, but you can debug the COBOL programs that are invoked by the job (that is, EXEC PGM=COBOL-prog-name). Breakpoints within these invoked programs are honored in the same way as when debugged locally.

You can also set breakpoints on the JCL, at project level: specify a job name, a job number, a step name or the top-level program on the JCL Debugging type options in the debug configuration and execution breaks at the first available point after the criteria is met. These choices are useful when performing remote debugging, and support multiple users debugging on the same region.

In this section, we will set the breakpoints directly in the COBOL code, on the enterprise server we created locally. See the links at the bottom of the page for further reading on enabling some of the other functionality.

Set breakpoints in JCLCREAT.cbl and JCLREAD.cbl

  1. On the Application Explorer view, double-click the JCLREAD.cbl and JCLCREAT.cbl programs to open them in the COBOL editor.
  2. To add the following breakpoints:
    COBOL File Breakpoint Code
    JCLCREAT.cbl OPEN OUTPUT OUTFILE
    JCLREAD.cbl OPEN INPUT INFILE

    Place your cursor in the far-left column on the line containing the breakpoint code, and double-click to set the breakpoint.

Debug the application

  1. From the main menu, click Run > Debug or press F11.
  2. In the Debug As dialog box, click JCL on COBOL Enterprise Server, and then click OK.

    This starts the JCLDEMO server and also prompts you to confirm the switch to the Debug perspective. Click No to stay in the Team Developer perspective.

  3. From the Application Explorer view, right-click ESJCL.jcl, and then select Submit JCL to associated Server from the context menu.

    The debugger stops in your JCLCREAT program at the breakpoint.

  4. Click Step Into Step Into a couple of times to step through a few lines.
  5. Click Resume Resume to continue.

    The debugger stops again at the breakpoint in the JCLREAD program.

  6. To terminate the debug session, click Terminate Terminate.

This concludes the tutorial.