Bram,
I believe as of V9.0 (maybe 9.1), there is a
sysvar.currentFunctionName - current function
and
sysvar.currentContainerName - current program, library, etc with package name
sysvar.currentAliasName - current program's alias name (I assume also works for library, etc).
For reference, there is also:
sysvar.currentLineNumber
and
syslib.getCurrentCallStack
markevans