Rational Developer for System z, Version 7.6

Preparing a DB2 program

You do not need to use any special coding techniques to debug DB2® programs with Debug Tool.

The following sections describe the tasks you need to do to prepare a DB2 program for debugging:

  1. Processing SQL statements.
  2. Linking DB2 programs for debugging.
  3. Binding DB2 programs for debugging.

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

Processing SQL statements

You must run your program through the DB2 preprocessor or coprocessor, which processes SQL statements, either before or as part of the compilation. In this section, we describe how and when each compiler uses the DB2 preprocessor or coprocessor. Then you can choose the right method so that you can debug the program with Debug Tool.

Important: Ensure that your program source, separate debug file, or program listing is stored in a permanent data set that is available to Debug Tool.

To enhance the performance of Debug Tool, use a large block size when you save these files. If you are using COBOL or Enterprise PL/I separate debug files, it is important that you allocate these files with the correct attributes to optimize the performance of Debug Tool. Use the following attributes for the PDS that contains the COBOL or PL/I separate debug file:

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

Linking DB2 programs for debugging

To debug DB2 programs, you must link the output from the compiler into your program load library. You can include the user run-time options module, CEEUOPT, by doing the following:

  1. Find the user run-time options program CEEUOPT in the Language Environment SCEESAMP library.
  2. Change the NOTEST parameter into the desired TEST parameter. For example:
    old:  NOTEST=(ALL,*,PROMPT,INSPPREF),
    new:  TEST=(,*,;,*),

    If you are using remote debug mode, specify the TCPIP suboption, as in the following example:

    TEST=(,,,TCPIP&&9.24.104.79%8001:*)
    Note:
    Double ampersand is required.

    If you are use a full-screen mode through a VTAM terminal session without the Debug Tool Terminal Interface Manager, specify the MFI suboption with a VTAM® LU name, as in the following example:

    Test=(,,,MFI%TRMLU001)

    If you are use a full-screen mode through a VTAM terminal session with the Debug Tool Terminal Interface Manager, specify the VTAM suboption with your user ID, as in the following example:

    Test=(,,,VTAM%USERABCD)
  3. Assemble the CEEUOPT program and keep the object code.
  4. Link-edit the CEEUOPT object code with any program to start Debug Tool.

The modified assembler program, CEEUOPT, is shown below.

*/****************************************************************/
*/* LICENSED MATERIALS - PROPERTY OF IBM                         */
*/*                                                              */
*/* 5694-A01                                                     */
*/*                                                              */
*/* (C) COPYRIGHT IBM CORP. 1991, 2001                           */
*/*                                                              */
*/* US GOVERNMENT USERS RESTRICTED RIGHTS - USE,                 */
*/* DUPLICATION OR DISCLOSURE RESTRICTED BY GSA ADP              */
*/* SCHEDULE CONTRACT WITH IBM CORP.                             */
*/*                                                              */
*/* STATUS = HLE7705                                             */
*/****************************************************************/
CEEUOPT  CSECT
CEEUOPT  AMODE ANY
CEEUOPT  RMODE ANY
         CEEXOPT TEST=(,*,;,*)
         END

The user run-time options program can be assembled with predefined TEST run-time options to establish defaults for one or more applications. Link-editing an application with this program results in the default options when that application is started.

If your system programmer has not already done so, include all the proper libraries in the SYSLIB concatenation. For example, the ISPLOAD library for ISPLINK calls, and the DB2 DSNLOAD library for the DB2 interface modules (DSNxxxx).

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

Binding DB2 programs for debugging

Before you can run your DB2 program, you must run a DB2 bind in order to bind your program with the relevant DBRM output from the precompiler step. No special requirements are needed for Debug Tool.


Terms of use | Feedback

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