Is there a system variable that can be used to determine the previous program that called a subprogram? I am looking for a way to determine the calling program or subprogram that just called the subprogram that I am working on. Over 70 modules are calling the subprogram. In other words, if the calling program is DFPOACEA and the subprogram is DFNRO096, is there a system variable that I can use to make decisions on that gives me the calling program name of DFPOACEA?
No, there is no system variable, but check out
USR0600N and USR4214N in lib SYSEXT, these
subprograms provide “call stack” information.