Results 1 to 3 of 3

Thread: SQLRPG Debugging

  1. #1
    Code400 Newbie
    Join Date
    Oct 2008
    Location
    Montgomery
    Posts
    2
    Rep Power
    0

    SQLRPG Debugging

    I am trying to debug my connect program (to another site) and I am having trouble getting into the debug source. This is just a test program for the connect there more to it but I am starting to test with the connect part.
    I compile the SQLRPG program with *xref in the precompiler
    and I STRDBG with update prod data = yes
    But I do not get the source at the time I call the PRogram
    What I am missing?
    BTW this is my second time creating a sqlrpg program
    Help!

    Program
    C/EXEC SQL CONNECT TO MTP USER :USERID USING :PASSWD
    C*
    C/END-EXEC
    C*
    C*
    C/EXEC SQL
    C+ DECLARE mppo CURSOR FOR
    C+ SELECT pdupmj, pddoco, pdlitm
    C+ FROM F4311
    C+ FROM F4311
    C+ WHERE pdan8 = 11015 AND PDNXTR < '900'
    C+ AND pduopn > 0
    C+ GROUP BY pdupmj, pddoco, pdlitm
    C+ ORDER BY pdupmj
    C/END-EXEC
    C*
    C*
    C *INLR CABEQ'1' EOJ
    C*
    C*
    C SQLCOD IFNE *ZEROS
    C SETON LR
    c*
    C ENDIF
    C*
    C *INLR CABEQ'1' EOJ
    C*
    C*
    C EOJ TAG
    C* ------ ---
    C/EXEC SQL DISCONNECT MTPDS01
    C*
    C/END-EXEC
    C********************************

    If you see this web site it will give you the process to compile
    http://www-01.ibm.com/support/docvie...25678a007aaaaa

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

    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 function key).
    Last edited by hvazquez; October 1st, 2008 at 03:48 PM. Reason: Problem solved

  2. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

  3. #2
    Programmer Mercury's Avatar
    Join Date
    Feb 2007
    Location
    Paris, France
    Posts
    1,831
    Rep Power
    5424

    Re: SQLRPG Debugging

    1/ Compile the OPM source with embedded SQL in debug mode
    Code:
    CRTSQLRPG PGM(...)  OPTION(*NOSRC *LSTDBG)
    2/ Start debug and add breakpoints
    Code:
    STRDBG PGM(...) OPMSRC(*YES)
    3/ Call the program
    Code:
    CALL PGM(...) ...
    Philippe

  4. #3
    Code400 Newbie
    Join Date
    Oct 2008
    Location
    Montgomery
    Posts
    2
    Rep Power
    0

    Re: SQLRPG Debugging

    Mercury

    Thanks

    for the information it work to perfection - It gave the source and I was able to debug.

    hvazquez

  5. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Problem to change RPG to SQLRPG
    By IroCorp in forum SQL
    Replies: 12
    Last Post: July 30th, 2008, 09:07 AM
  2. how to debug sqlrpg prg?
    By Deepa in forum RPG/RPGLE
    Replies: 7
    Last Post: March 31st, 2008, 08:21 AM
  3. SQLRPG running X times and never more ...
    By croco411 in forum RPG/RPGLE
    Replies: 13
    Last Post: February 3rd, 2006, 10:54 AM
  4. debugging the service programs
    By mksamy_99 in forum RPG/RPGLE
    Replies: 3
    Last Post: September 1st, 2005, 07:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •