STRDBG CLASS has no meaning unless a java program has been started first. Unlike traditional debug support, where a user may start debug first, set breakpoints, then call the program, the Java user must first issue the java command, then issue STRDBG.
Looking to see if anyone else has experienced this problem. It could be related to recent PTF's that were applied and maybe a default parameter value was altered. Let me start with I do not have any issues with viewing the source while in debug with any of the RPGLE or CLLE programs using RDI or STRDBG, the issue only occurs when viewing code in a service program. The service program has been around for awhile and I can currently debug it using RDI and view the source. But when I recreate the module and service program in another library, RDI cannot locate the source with an error message stating it cannot locate the source in QSQLTEMP1.
When I compile the module interactively, source physical file QSQLTEMP1 is created in QTEMP containing a member of the compiled version of the code. Debugging it using the green screen STRDBG will work but only when QSQLTEMP1 and the member is present. This means I cannot use it in another job or use RDI. Now I could move it to a permanent library but this should not be the case. Hoping I am missing something obvious. Here is the command I am using with all of the parameters. OBJ GET0001S Library.
PROJ2417 Source file. SRCFILE QRPGLESRC Library. PROJ2417 Source member.
SRCMBR GET0001S Source stream file. SRCSTMF Commitment control. COMMIT.NONE Relational database. RDB.LOCAL Compile type.
OBJTYPE.MODULE Listing output. OUTPUT.NONE Text 'description'. TEXT.SRCMBRTXT Additional Parameters Precompiler options.
OPTION.XREF + for more values RPG preprocessor options. RPGPPOPT.NONE Target release. TGTRLS.CURRENT INCLUDE file. INCFILE.SRCFILE Library.LIBL SQL INCLUDE directory. INCDIR.NONE Allow copy of data. ALWCPYDTA.OPTIMIZE Close SQL cursor. CLOSQLCSR.ENDMOD Allow blocking.
ALWBLK.ALLREAD Delay PREPARE. DLYPRP.NO Concurrent access resolution. CONACC.DFT Severity level. GENLVL 10 Date format. DATFMT.JOB Date separator character. DATSEP.JOB Time format. TIMFMT.HMS Time separator character.
TIMSEP.JOB Replace. REPLACE.YES RDB connect method. RDBCNNMTH.DUW Default collection. DFTRDBCOL.NONE Dynamic default collection. DYNDFTCOL.NO Package. SQLPKG.OBJ Library.OBJLIB SQL path.
![How to debug windows service How to debug windows service](/uploads/1/2/5/5/125503083/110672180.jpg)
SQLPATH.NAMING + for more values SQL rules. SQLCURRULE.DB2 IBM SQL flagging.
SAAFLAG.NOFLAG ANS flagging. FLAGSTD.NONE Print file. PRTFILE QSYSPRT Library.LIBL Debugging view. DBGVIEW.SOURCE Debug encryption key. DBGENCKEY.NONE User profile. USRPRF.NAMING Dynamic user profile.
DYNUSRPRF.USER Sort sequence. SRTSEQ.JOB Library. Language id. LANGID.JOB To source file.
TOSRCFILE QSQLTEMP1 Library. QTEMP Decimal result options: DECRESULT Maximum precision. 31 Maximum scale.
31 Minimum divide scale. 0 Decimal float rounding mode. DECFLTRND.HALFEVEN Compiler options.
COMPILEOPT.NONE Thank you.
Once in a while I find a program in one the libraries I am responsible for that is missing the source it was compiled from. Looking at the object description I can see that the program was compiled from a source member in the right source file, but the member is not there. Other times a program was compiled from a member in a source file or library that no longer exists, but I can find a member of that name elsewhere, and I do not know if this source is the same that was used to create the program.
Both scenarios should not happen in a perfect world, but most of us work in places that are not perfect. I know there are programs various people have written to retrieve the source from a program, but I do not have time to do that today. I need to get to the source quickly to find out what this program is suppose to do.
If the object is either a CLP or CLLE and it was compiled with the 'Allow RTVCLSRC' parameter, ALWRTVSRC, set to.YES I can use the Retrieve CL Source command, RTVCLSRC, to recover the source. I go into this in detail in.
If it is RPG or RPGLE then there is no IBM command to retrieve the source code. I need to be a bit creative in my thinking.
When I compile a RPG/RPGLE object I have choices in the debug views and these are included in the compiled object. I wrote about the debug views and the advantages of them for RPGLE in. With old fashioned RPG/400 (RPG III) I have fewer options. If the program was compiled with the 'Source listing options' parameter, OPTION, of.SRCDBG or.LSTDBG then the source was included in the program object.
CRTRPGPGM PGM(MYLIB/RPG3PGM) SRCFILE(DEVSRC) OPTION(.SRCDBG) As neither of these are the parameters default there is a good chance that if the person who performed the compile used PDM and they just put a '14' next to the member and pressed Enter the source will be missing from the object. The other debugger that many of us have used with old RPG source is STRISDB. This will display the source for the program if the source member is where it was when the program was compiled. If the member has been deleted, renamed, or moved STRISDB cannot display the source code. I am going to say that today I am lucky, and the program I need to the retrieve the source for was compiled with the appropriate debug values.
I can just start debug using the 'Start debug' command, STRDBG, for both RPGLE and RPG: For RPGLE objects: STRDBG PGM(PGMSDH/TESTRPG) For RPG object: STRDBG PGM(PGMSDH/TESTRPG3) OPMSRC(.YES) And the source code is displayed: Display Module Source Program: TESTRPG Library: MYLIB Module: TESTRPG 1.free 2 dcl-s Date1 char(6); 3 dcl-s Date2 char(6); 4 dcl-s Difference packed(10); 5 6 Date1 = '122516'; 7 Date2 = '022195'; 8 9 Difference =%diff(%date(Date1:.mdy0):%date(Date2:.mdy0):.d); 10 11.inlr =.on; Bottom Debug. F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable F12=Resume F17=Watch variable F18=Work with watch F24=More keys In this example it would be easy to copy-n-paste the source into a source member. But if the program was one of those thousand line monsters it would take a long time to copy a screen of the source at a time. Fortunately there is an easier way to do a larger program than the one shown above.
If you do not have RDi, Operations Navigator has a debug feature within the 'Run SQL Scripts' function. On your computer Operation Navigator could be known as iSeries Navigator or System i Navigator. When I open the IBM i Access for Windows folder from the start menu I find Operation Navigator within it. On my PC it is called System i Navigator.
Click on image to open a larger version in another browser window When the Navigator opens in the left panel is a list of all IBM i I can connect to. I find the one with the program on it and click the plus ( + ) next to it. Then I find the 'Databases' icon and click on the plus next to it. When that opens immediately under it is the database I want, I right click on it and select 'Run SQL scripts', see below. Click on image to open a larger version in another browser window On the 'Run SQL Scripts' window I select 'Run', and then 'Debugger' in the drop down.
Click on image to open a larger version in another browser window When the 'Start debugger' window opens I just need to enter the program and the library it is in, and click the 'OK' button. Click on image to open a larger version in another browser window I can go to the code section part of the 'System Debugger' window, select all the code ( Ctrl-a ), copy it ( Ctrl-c), then paste it into Notepad ( Ctrl-v ).
Click on image to open a larger version in another browser window I save the contents of Notepad as a text file. I can now FTP that to the IBM i and place it in the appropriate source file.
I would also compile the source to make ensure the next time I look at that object it refers to the right source member. As you can imagine this has saved me on many occasions where the source has gone missing. I strongly suggest that you all compile your programs and modules with an appropriate debug view. You never know when you have to hunt for missing source, and be grateful that you did. This article was written for IBM i 7.3, and should work for earlier releases too. AnonymousSeptember 28, 2016 at 2:09 PM I tried to get the source but It ask me about the member of the object. And that's the point I don't have it.
I have only the object.:( Reply Replies Simon HutchinsonSeptember 28, 2016 at 3:10 PM Please be more specific: Where are you seeing this? I am also having the same issue. We are trying to recover source of RPG program which wasn't compiled to include source. So there is no source view.
In iseries navigator, I am getting error Source file not available for. Is the source file located on this client? Thank you Herman.