Rational Developer for System z, Version 7.6

Debugging DB2 programs

While you debug a program containing SQL statements, remember the following behaviors:

The topics below describe the steps you need to follow to use Debug Tool to debug your DB2 programs.

Refer to the following topics for more information related to the material discussed in this topic.

Debugging DB2 programs in batch mode

In order to debug your program with Debug Tool while in batch mode, follow these steps:

  1. Make sure the Debug Tool modules are available, either by STEPLIB or through the LINKLIB.
  2. Provide all the data set definitions in the form of DD statements (example: Log, Preference, list, and so on).
  3. Specify your debug commands in the command input file.
  4. Run your program through the TSO batch facility.

Refer to the following topics for more information related to the material discussed in this topic.

Debugging DB2 programs in full-screen mode

In full-screen mode, you can decide at debug time what debugging commands you want issued during the test.

Using Debug Tool Setup Utility (DTSU)

The Debug Tool Setup Utility is available through Debug Tool Utilities.

  1. Start DTSU by using the TSO command or the ISPF panel option, if available. Contact your system administrator to determine if the ISPF panel option is available.
  2. Create a setup file. Remember to select the Initialize New setup file for DB2 field.
  3. Enter appropriate information for all the fields. Remember to enter the proper commands in the DSN command options and the RUN command options fields.
  4. Enter the RUN command to run the DB2 program.

Using TSO commands

  1. Ensure that either you or your system programmer has allocated all the required data sets through a CLIST or REXX EXEC.
  2. Issue the DSN command to start DB2.
  3. Issue the RUN subcommand to execute your program. The TEST run-time option can be specified as a parameter on the RUN subcommand. An example for a COBOL program is:
    RUN PROG(progname) PLAN(planname) LIB('user.library')
        PARMS('/TEST(,*,;,*)')

Using TSO/Call Access Facility (CAF)

  1. Link-edit the CAF language interface module DSNALI with your program.
  2. Ensure that the data sets required by Debug Tool and your program have been allocated through a CLIST or REXX procedure.
  3. Enter the TSO CALL command CALL 'user.library(name of your program)', to start your program. Include the TEST run-time option as a parameter in this command.

In full-screen mode through a VTAM terminal without the Debug Tool Terminal Interface Manager

  1. Specify the MFI%LU_name parameter as part of the TEST runtime option.
  2. Follow the other requirements for debugging DB2 programs either under TSO or in batch mode.

In full-screen mode through a VTAM terminal with the Debug Tool Terminal Interface Manager

  1. Specify the VTAM%userid parameter as part of the TEST runtime option.
  2. Follow the other requirements for debugging DB2 programs either under TSO or in batch mode.

After your program has been initiated, debug your program by issuing the required Debug Tool commands.

Note:
If your source does not come up in Debug Tool when you launch it, check that the listing or source file name corresponds to the MVS library name, and that you have at least read access to that MVS library.

Refer to the following topics for more information related to the material discussed in this topic.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)