IBM Support

RPG Cafe: Fall 2024: Use %PROC() in ON-EXIT

News


Abstract

Information about the PTFs to provide the ILE RPG enhancement to allow the %PROC built-in function in the ON-EXIT section of a procedure

Content

You are in: RPG Cafe > RPG Cafe: Fall 2024: Use %PROC() in ON-EXIT

Short URL: https://ibm.biz/rpgcafe_fall_2024_bif_proc_in_on_exit

Fall 2024: Use %PROC() in ON-EXIT

You can now use %PROC() in the ON-EXIT section of a procedure. But since the ON-EXIT section is actually handled in a separate procedure, there are two possible meanings, so you have to specify a parameter when it's in the ON-EXIT section.

  • %PROC(*ONEXIT) returns the external name of the procedure that implements the ON-EXIT section.
  • %PROC(*OWNER) returns the external name of the procedure that contains the ON-EXIT section.

Outside of the ON-EXIT section, you don't specify any parameter for %PROC().

Example of %PROC in a procedure with an ON-EXIT section.

          ctl-opt dftactgrp(*no);

          dcl-pr myproc extproc('ABC123_myproc') end-pr;

          myproc();
          return;

          dcl-proc myproc;
             snd-msg 'This procedure is ' + %proc();
          on-exit;
             snd-msg 'This ON-EXIT procedure is ' + %proc(*onexit);
             snd-msg 'The procedure itself is ' + %proc(*owner);
          end-proc;

          -------------------  Output  -------------------------

          This procedure is ABC123_myproc
          This ON-EXIT procedure is _QRNI_ON_EXIT_ABC123_myproc
          The procedure itself is ABC123_myproc

.                                                            .
.                                                            .

PTFs for 7.4 and 7.5

7.4:

  • ILE RPG compiler: 5770WDS SJ02912

7.5:

  • ILE RPG compiler: 5770WDS SJ02922
  • ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SJ02923

RDi support

The next update for RDi will support these enhancements.

Documentation

The 7.4 and 7.5 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about these enhancements.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.4.0;7.5.0;and future releases"}]

Document Information

Modified date:
12 December 2024

UID

ibm17172104