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 Debug tab of the project properties 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 Solution Explorer, 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 Debug > Start Debugging or press F5.

    The debugger enters a wait state.

  2. In the Solution Explorer, right-click ESJCL.jcl, and then select Submit JCL from the context menu.

    The debugger stops in your JCLCREAT program at the breakpoint.

  3. Click Debug > Step Into, or press F11, a couple of times to step through a few lines.
  4. Click Continue Continue to continue.

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

  5. To terminate the debug session, click Stop Debugging Stop Debugging.

This concludes the tutorial.