To debug a stored procedure, it must be built with specific
compiler and runtime options.
About this task
For an alternative method for debugging stored procedures,
see ../../com.ibm.debug.pdt.zpcl.doc/topics/czddb2debug.html.
Procedure
- Edit the property group that is associated with the store
procedure.
- On the Procedures and Steps page of
the COBOL Settings or PL/I Settings,
open the Step options for the enabled compilation
step.
- In the Compiler options field, specify TEST.
You must also specify a listing data set in the property group.
If you use the TEST(NONE,SYM,SEP) compiler option,
you must specify a SYSDEBUG data set.
- Close and save the property group.
- Update the DDL for the stored procedure to specify run
options:
- To open the DDL for the stored procedure, selecting
the Open DDL menu item.
- Add the stored procedure option RUN OPTIONS.
The following example shows the
RUN OPTIONS suboption
of the
CREATE PROCEDURE statement. In this example,
the user's IP address is 9.77.111.111. The debug listener in the debug
perspective is listening on the default port, 8001.
RUN OPTIONS 'TEST(,,,TCPIP&9.77.111.111%8001:*)'
- Build the stored procedure as described in Building a stored procedure.
- Run the stored procedure as described in Running a stored procedure.
The Debug perspective
opens automatically when the stored procedure started.
- Click OK if the following message
is displayed:
- EQA2383I The environment is not yet fully initialized. Use Step
or Run.
Breakpoints can be set by double-clicking the gray vertical
bar on the right side of the Source view.
- Click Resume on the window bar of
the Debug view to run from one breakpoint to
the next.
- Click Step Into on the window bar
of the Debug view to step from one statement
to the next.
- Change variable values by double-clicking the variable
in the Variables view of the Debug perspective,
typing the new value for the variable, and clicking OK.
The values of the variables are displayed in the Variables view
of the Debug perspective.
- Click OK if the following exception
occurs when you debug 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.
- Click OK when the Debugger
Message window says that the Application is Terminated.
- Click Data Perspective to switch
back to the Data Perspective.