I've switched from using the Get Call Stack API to using the classic Snd/Rcv message APIs for my getCallerPgmName() function in COZTOOLS.
I had to switch because I was finding that the callstack API wasn't always returning a value--or in some cases was returning blanks. This was observed during web/CGI program processing. Normally this can be expected if the pgm was recreated or is locked by a SAVxxx command; but I'm being told that is not the case here.
The only shortcoming to using the Snd/Rcv msg APIs is that you don't get the library name of the caller, which is returned by the callstack API.