Program A is my main program, and Program A is calling program B, and program B is calling program C, and program C is calling program D, like that how many programs we can call? is there any limit or we can call any number of subprograms?
if the limit is there, what is the limit for batch programs, and what is the limit for online programs.
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
There is no absolute limit to the number of subroutines you can call. Each time a subroutine is called a register save area is set up to save the environment of the calling program including the address to return control to. If the subroutine calls another subroutine, another register save area is set up to save that environment. The practical limit to the number of subroutines you can call will be determined by the region size you are running in and the size of the subroutines.