Start Debugging

Debugging requires no changes to your program code. It requires that your project is associated with the JCLDEMO enterprise server and that the enterprise server is configured to enable dynamic debugging, which you performed in the previous steps.

  1. Ensure you are in the Team Developer perspective.
  2. Double-click the JCLREAD.cbl and JCLCREAT.cbl files in the jcl project, from Application Explorer view, to open them.
  3. Introduce breakpoints in both files:

    On a line in the Procedure Division, double-click in the left margin to insert a breakpoint.

    For example, in JCLREAD.cbl, set a breakpoint on the line for OPEN INPUT INFILE. In JCLCREAT.cbl, set a breakpoint for the line for OPEN OUTPUT OUTFILE.

  4. Choose Run > Debug or press F11.
  5. Click JCL on COBOL Enterprise Server in the Debug As dialog box, and click OK.

    This starts the JCLDEMO server and also prompts you to confirm the switch to the Debug perspective. Click Yes to switch to the Debug perspective.

  6. Submit the JCL file. (You will need to switch from the Debug Perspective in the IDE to the Team Developer Perspective to do this.)

    The debugger stops in your JCLCREAT program at the breakpoint.

  7. Step through a few lines and press F8 to continue.
    The debugger should stop again in the JCLREAD program.
    Tip: If you want to view the list of attached debuggers, work through the next topic before performing the next step.
  8. Once you’ve completed your debug session, select Run > Terminate.

Notice the messages that have appeared in the Console.