Displaying the call stack

To display the call stack, use the Display Debug (DSPDBG) command.

The call stack 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.

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:
  1. CL programs can be recursive; that is, a CL program can call itself either directly or indirectly through a program it has called.
  2. Some high-level languages do not allow recursive program calls. Other languages allow not only programs to be recursive, but also procedures within a program to be recursive. (In this guide, the term recursion level refers to the number of times the program has been called in the call stack. A procedure's recursion level is referred to explicitly as the procedure recursion level.)
  3. All CL commands and displays make use of only the program qualified name recursion level.