Until the last round of Technical Refreshes, IBM i 7.2 TR7 and 7.3 TR3, I could not find a way to retrieve the name of the procedure that I was in. The program data structure enticed me with the *PROC keyword. This was not the procedure's name, but rather either the program's or module's name.
01 DPgmDs SDS qualified 02 D ProcName *PROC 01 dcl-ds PgmDs psds qualified ; 02 ProcName *proc ; 03 end-ds ; |
Fortunately these two Technical Refreshes introduced a new built in function, BiF, to returns the name of the current procedure: %PROC
This example is of what I call a closed subprocedure and how this new BiF works.



