A function, method or program may be activated recursively. Therefore, several instances of a function, method or program may be active at once.
An instance of a function is placed in an active state when it is successfully activated and remains active until the execution of a STOP statement or an implicit or explicit function format of the EXIT statement with this instance of this function.
An instance of a method is placed in an active state when it is successfully activated and remains active until the execution of a STOP statement or an implicit or explicit EXIT METHOD statement within this instance of this method.
An instance of a program is placed in an active state when it is successfully activated by the operating system or successfully called from a runtime element. An instance of a program remains active until the execution of one of the following:
Whenever an instance of a function, method or program is activated, the control mechanisms for PERFORM statements contained in that instance of the function, method or program are set to their initial states and the GO TO statements referred to by ALTER statements are set to their initial states.