ContentsIndexPreviousNext

RECURSION

ACUCOBOL-GT allows a program to call itself, directly or indirectly. A CALL statement that attempts to call an active program is termed a recursive call.

To use recursive calls, you must set the variable RECURSION to "1" (on, true, yes). The default setting for RECURSION is "0" (off, false, no), which disallows recursive calls.

The runtime system shares the program code for recursively called programs. Thus, while each recursion level has its own set of data, there is only one copy of the Procedure Division code in memory, regardless of how many active copies of the program there are. The runtime system does not, however, share overlays. Each copy of the program in memory has its own overlay area.