Debugging RPG/400 (OPM and ILE) with Embedded SQL Statements

Technote (troubleshooting)


Problem(Abstract)

This document describes the procedure for debugging RPG/400 and ILE RPG programs containing embedded SQL statements.

Resolving the problem

This document describes the procedure for debugging RPG/400 and ILE RPG programs containing embedded SQL statements. The command CRTSQLRPG and its ILE counterpart CRTSQLRPGI offer no parameters to generate optional debugging views. To produce a debugger-viewable version of the source code, do the following:

OPM RPG/400 Procedure:

CRTSQLRPG PGM(member_name) OPTION(*NOGEN)

This expands the embedded SQL statements into RPG specifications and creates a member of type RPG in QTEMP/QSQLTEMP. The new member will have the same name as the original SQLRPG member.

CRTRPGPGM PGM(QTEMP/member_name) SRCFILE(QTEMP/QSQLTEMP) OPTION(*LSTDBG)
or
CRTRPGPGM PGM(QTEMP/member_name) SRCFILE(QTEMP/QSQLTEMP) OPTION(*SRCDBG)

This creates a debugger-viewable RPG program object, which can be debugged using STRDBG.

ILE RPG/400 Procedure:

CRTSQLRPGI PGM(member_name) OPTION(*NOGEN)

This expands the embedded SQL statements into RPG specifications and creates a member of type RPGLE in QTEMP/QSQLTEMP1. The new member will have the same name as the original SQLRPGLE member.

CRTBNDRPG PGM(QTEMP/member_name) SRCFILE(QTEMP/QSQLTEMP1) DBGVIEW(*ALL)

This creates a debugger-viewable ILE RPG program object, which can be debugged using STRDBG.

Note: STRDBG has to be used for both OPM and ILE programs. ISDB (which only operates on OPM programs) will bring up the original (not the preprocessed) version of the source code from the SQLRPG member; this mismatch between the program object and the source code retrieved by the debugger may cause errors during the debugging session (notably MSGCPF1920 when trying to set breakpoints with the <F6> function key).

Historical Number

16172039

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

IBM i
Programming (Languages- compilers- tools)

Software version:

4.4.0, 4.5.0, 5.1.0, 5.2.0, 5.3.0, 5.3.5, 5.4.0, 5.4.5, 6.1.0, 7.1.0

Operating system(s):

IBM i

Reference #:

N1018045

Modified date:

2012-04-23

Translate my page

Machine Translation

Content navigation