Debug the OPDEMO Application

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.

  1. On the main menu in Eclipse, click Run > Debug Configurations.
  2. In the left pane of the Debug Configurations dialog box, double-click PL/I Enterprise Server.
  3. Change the name from New_configuration to PLIJCLdemo.
  4. In the Enterprise Server section, select Connection, click Browse, and then select the PLIDEMO enterprise server instance.
  5. In the Debugging type section, click the JCL tab.
  6. In the Top-level program field, type OPDEMO.
  7. Click Apply.
  8. Click Debug.
  9. 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.

  10. Click Yes.

Submit opdemo.jcl

  • In the Eclipse Application Explorer view, right-click opdemo.jcl, and select Submit JCL to associated Server from the context menu.

    The JCL is submitted to the PLIDEMO server, and debugging starts. The debugger pauses at the following line: OPDEMO: PROC(JCLPARM) OPTIONS(MAIN) REORDER;.

Debug OPDEMO

  1. 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.
  2. Click or press F5 to step into the program. This takes you to line 77 that reads:
    on error begin;
  3. 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.

  4. Click several more times until you get to the line that reads:
    SYSPRINT_BUFF = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' || /* 26 */
  5. Double-click SYSPRINT_BUFF to select it.
  6. Right-click SYSPRINT_BUFF, and then select Inspect item to inspect the variable.
  7. Click Add to Expressions View.

    SYSPRINT_BUFF and its current value appear in the Expressions pane.

  8. Click and see how the value of SYSPRINT_BUFF changes to ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ12.
  9. Click a few more times until you reach the line that reads:
    sysin_num_recs = '0';

    This line initiates the SYSIN_NUM_RECS variable.

  10. Add SYSIN_NUM_RECS to the Expressions pane and note its value.
  11. Click and check the value of SYSIN_NUM_RECS in the Expressions pane. It has changed to 0000.
  12. Click a few more times until you reach the line that reads:
    sysin_num_recs = sysin_num_recs + 1;
  13. Step into it and notice how the value changes to 0001.
  14. Go to the last line of opdemo.pli where the END statement is and put the cursor on it.
  15. 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.

  16. 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.