RPG enhancement to add Control keyword DEBUG(*RETVAL), to debug the return value from a procedure.
You are in: RPG Cafe > Debug the return value for a procedure
Short URL: https://ibm.biz/rpgcafe_debug_retval
RPG Cafe: Debug the return value for a procedure
Control keyword DEBUG(*RETVAL)
When DEBUG(*RETVAL) is specified in the Control keywords, you can view or change the value returned from a procedure in the debugger, when you are at the breakpoint for the end of the procedure.
You work with the special variable _QRNU_RETVAL in the debugger.
A debug session with DEBUG(*RETVAL)
- The programmer is debugging the following procedure.
- The debug session is stopped at statement 5.
- The programmer checks the value of EVAL _QRNU_RETVAL.
- The debugger indicates that the value of _QRNU_RETVAL is 25.
- The programmer changes EVAL _QRNU_RETVAL to 26.
- The debugger now indicates that the value of _QRNU_RETVAL is 26.
- The value returned from the procedure is 26.
1. DCL-PROC myProc; 2. DCL-PI *N INT(10) END-PI; 3. 4. RETURN 25; 5. END-PROC;
PTFs for 7.3 and 7.4, available in November 2020
- ILE RPG compiler: SI74612
- ILE RPG compiler: SI74613
- ILE RPG compiler, TGTRLS(V7R3M0): SI74614
The ILE RPG compiler PTFs will also be available with the Db2 for i Fix Packs. See Db2 for IBM i 2020 PTF Group Schedule.
The next release of RDi will support this enhancement.
Documentation in the IBM Knowledge Center
The ILE RPG Reference and ILE RPG Programmer's Guide in the 7.3 and 7.4 IBM Knowledge Center are updated with full information about this enhancement. Start at the What's New Since 7.3 or What's New Since 7.4 section in the Programmer's Guide for information about the command parameter, and start at the What's New Since 7.3 or What's New Since 7.4 section in the Programmer's Guide for information about the Control keyword.
- 7.3 Reference: What's new since 7.3: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/rpgrelv7r3post.htm
- 7.3 Programmer's Guide: What's new since 7.3: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/rpgrelv7r3post.htm
- 7.4 Reference: What's new since 7.4: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasd/rpgrelv7r4post.htm
- 7.4 Programmer's Guide: What's new since 7.4: https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/rzasc/rpgrelv7r4post.htm
12 November 2020