Walks you through the steps required to debug the OPDEMO PL/I application running under the control of JCL.
Create a debug configuration and launch
To debug In Eclipse, you create a debug configuration from which you launch a debug session.
- On the main menu in Eclipse, click
.
- In the left pane of the
Debug Configurations dialog box, double-click
PL/I Enterprise Server.
- Change the name from
New_configuration to
PLIJCLdemo.
- In the
Enterprise Server section, select
Connection, click
Browse, and then select the
PLIDEMO
enterprise server instance.
- In the
Debugging type section, click the
JCL tab.
- In the
Top-level program field, type
OPDEMO.
- Click
Apply.
- Click
Debug.
- If a dialog asking whether to enable dynamic debugging is displayed, select
Remember my decision and click
Yes.
Another dialog box is also displayed, prompting you to switch to the
Debug perspective.
- Click
Yes.
Debug OPDEMO
- If line numbers are not turned on in the source window, right-click in the left column of the source pane and select
Show Line Numbers.
- Click
or press
F5 to step into the program. This takes you to line 77 that reads:
on error begin;
- Double-click in the far left column to set a breakpoint.
The line appears in the
Breakpoints pane in the top right part of the
Debug perspective.
- Click
several more times until you get to the line that reads:
SYSPRINT_BUFF = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' || /* 26 */
- Double-click
SYSPRINT_BUFF to select it.
- Right-click
SYSPRINT_BUFF, and then select
Inspect item to inspect the variable.
- Click
Add to Expressions View.
SYSPRINT_BUFF and its current value appear in the
Expressions pane.
- Click
and see how the value of
SYSPRINT_BUFF changes to
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ12.
- Click
a few more times until you reach the line that reads:
sysin_num_recs = '0';
This line initiates the
SYSIN_NUM_RECS variable.
- Add
SYSIN_NUM_RECS to the
Expressions pane and note its value.
- Click
and check the value of
SYSIN_NUM_RECS in the
Expressions pane. It has changed to
0000.
- Click
a few more times until you reach the line that reads:
sysin_num_recs = sysin_num_recs + 1;
- Step into it and notice how the value changes to
0001.
- Go to the last line of
opdemo.pli where the
END statement is and put the cursor on it.
- Click
(or
CTRL+R) to run the program to that line.
When the debugger reaches the
END statement, you can see from the final value of
SYSIN_NUM_RECS (0004) that the program has processed five records.
- Click
Continue to run the program to its end.
Debugging ends automatically when the program is done running.
Note: To stop debugging at any time, click
.
Stop the PLIDEMO server
- In the
Server Explorer, right-click the
PLIDEMO server, and select
Stop from the context menu.
This concludes the tutorial.