Rational Developer for System z

Debugging a stored procedure

This is the process for debugging a stored procedure.

Before you begin

To debug a stored procedure, it must be built with specific compiler and runtime options. A compiler listing is also required for COBOL stored procedures.

Remove the stored procedure from the remote system as described in Removing a stored procedure.

Specify a compiler listing data set as described in Setting up the z/OS® build properties if you want to debug a COBOL stored procedure that has not been specified yet.

About this task

Procedure

  1. Click the Options tab in the Editor view and select the "Build Stored Procedure for Debugging" check box.
  2. Store the changes by pressing Ctrl+S on your keyboard.
  3. The generated runtime options from the Options page are propagated to the DDL page.
  4. Click the Deploy tab in the Editor view and enter “TEST” in the Compile options field.
  5. Store the changes by pressing Ctrl+S on your keyboard.
  6. Build the stored procedure as described in the section Building a stored procedure.
  7. Run the stored procedure as described in the section Running a stored procedure. The Debugging perspective opens automatically when the stored procedure has been invoked.
  8. Click OK if the following message appears:
    • EQA2383I The environment is not yet fully initialized. Use Step or Run.
  9. Breakpoints can be set by double clicking the gray vertical bar on the right side of the Source view.
  10. Click the Resume button on the window bar of the Debug view to run from one breakpoint to the next.
  11. Click the Step Into button on the window bar of the Debug view to step from one statement to the next.
  12. The values of the variables are displayed in the Variables view of the Debug perspective. You can change the values by double clicking on the variable. Then type the new value for the variable and click OK.
  13. Click OK if the following exception occurs when debugging a PL/I stored procedure:
    • The following exception has occurred: IBM0368W The FINISH condition was raised due to a RETURN or END statement in the main procedure.
  14. Click OK when the Debugger Message window says the “Application has Terminated.”
  15. Click the Data Perspective button to switch back to the Data Perspective.

Feedback