Exercise 5.2: Starting the integrated debugger

Before you begin, you must complete Exercise 5.1: Introducing the Integrated iSeries Debugger.

You will be working with the ILE RPG program PAYROLLG.

Note:
PAYROLLG is the same RPG program as PAYROLL but without compile errors. You are using it instead of PAYROLL in this exercise, to accommodate anyone who decided to skip right to this exercise without completing the editor exercises in Module 3. Editing source.

You can start the Debugger in several ways: directly from the pop-up menu of a program or service program in the Remote Systems view, or from a Launch Configurations window. Starting directly from the Remote Systems view doesn't allow you to specify parameters to be passed to the program. The Launch Configurations window allows you to modify how the program is invoked and to specify parameters.

To make the exercise interesting you will use CL program CLR1 to call PAYROLLG and you will pass one parameter to CLR1.

This means you will use the Launch Configurations window.

To start the debugger:

  1. In the Remote Systems view expand the Library list filter, if it isn't expanded already.
    Start Debug session
  2. Expand library RSELABXX, if it isn't expanded already.
  3. Select program CLR1 in library RSELABXX.
  4. Click the arrow beside the DEBUG icon Debug Icon on the workbench toolbar.
  5. Select Debug from the list.

    The Debug Launch Configurations window opens.

  6. Select iSeries: Debug Interactive Application under the Configurations list.
    Debug window
  7. Click New.
    Note:
    You could also use Debug(prompt) > Interactive from the pop-up menu.

    The right pane of the Debug Launch Configurations window opens.
    Debug config

  8. In the Name field, type the program name CLR1.
  9. Select the Update production files check box.
  10. Click the How To Start tab.

    The How To Start page opens.
    Debug: How to start section

    By default, the page contains a call for the program selected in the Remote Systems view.

  11. Click Prompt.

    The Call Program (CALL) window opens.
    Call Program window

  12. In the Parameters field, type 'XX' where 'XX' is your workstation number. Click Add.

    The parameter value will appear in the lower list.

    If you forget to click Add, the parameter will be missing from the CALL Program command and you will receive an error when the program tries to call the payroll program.

  13. Click OK.

    The complete start command for the program appears.
    Debug window

  14. Click Debug.

    The Debug perspective opens.

    If not, you may see this error message.
    Error message

    The Remote System Explorer communications server has been shut down in the meantime. Go to your 5250 emulator and restart the Remote System Explorer communications server following the instructions in the message. You don't have to cancel the message. It will be removed as soon as the connection between the Remote System Explorer communications server and the interactive session has been established. Now the Debug perspective is loaded in the workbench.

    Now that the program is active on the iSeries and stopped at the first executable statement, the debugger displays the source.
    Debug Perspective

You have started an interactive debug session and now you are ready to begin Exercise 5.3: Setting breakpoints.