You can specify the most recently called procedure as the base call stack entry by using the *PGMNAME special value.
The special value *PGMNAME is useful if you convert some CL programs, but not all CL programs, to ILE programs. For example, CLPGM71 is an OPM CL program; CLPGM73 sent messages to CLPGM71 and specifies TOPGMQ(*SAME CLPGM71). If CLPGM71 is converted to ILE, only the Send Program Message (SNDPGMMSG) command with the *PGM name in CLPGM73 (OPM) works. Specifying CLPGM71 as a simple name does not work because there was no entry in the call stack for CLPGM71. If you change the command to TOPGMQ(*SAME *PGMNAME *NONE CLPGM71), CLPGM73 sends messages successfully to CLPGM71 regardless of the names you may have used for procedure names.
The special value *PGMNAME can also be used with an OPM program name. In this case the effect is the same as if you just used the name. For example, TOPGMQ(*SAME *PGMNAME *NONE opmpgm) sends the message to the same place as TOPGMQ(*SAME opmpgm). The use of *PGMNAME should be considered when you cannot determine whether the message is being sent to an OPM program name or and ILE program name.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.