You can use the Display Debug (DSPDBG) command to display the call stack, which indicates:
A call of a program is the allocation of automatic storage for the program and the transfer of machine processing to the program. A series of calls is placed in a call stack. When a program finishes processing or transfers control, it is removed from the call stack. For more information about the call stack, see "Controlling Flow and Communicating between Programs and Procedures".
A program may be called a number of times while the first call is still in the call stack. Each call of a program is a recursion level of the program.
When a call is ended (the program returns or transfers control), automatic storage is returned to the system.
Notes:
An activation of a program is the allocation of static storage for the program. An activation is always ended when one of the following happens:
In addition, an activation can be destroyed by actions taken during a program call. These actions are dependent on the language (HLL or CL) in which the program is written.
When a program is deactivated, static storage is returned to the system. The language (HLL or CL) in which the program is written determines when the program is normally deactivated. A CL program is always deactivated when the program ends.
An RPG/400(R) program is deactivated when the last record indicator (LR) is set on before the program ends. If there is a return operation and LR is off, the program is not deactivated.
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.