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.
- Ensure you are in the Team Developer perspective.
- Double-click the
JCLREAD.cbl and
JCLCREAT.cbl files in the
jcl project, from
Application Explorer view, to open them.
- 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.
- Choose
Run > Debug or press
F11.
- 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.
- 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.
- 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.
- Once you’ve completed your debug session, select
Run > Terminate.
Notice the messages that have appeared in the
Console.