ROUTINE_MODULE global variable

This built-in global variable contains the module name of the currently executing routine.

This global variable has the following characteristics:
  • It is read-only, with values maintained by system.
  • The type is VARCHAR(128).
  • The schema is SYSIBM.
  • The scope of this global variable is session.

If the currently executing routine does not belong to a module or if the variable is referenced outside a routine execution context, the value of the ROUTINE_MODULE global variable is NULL.

Notes

The value of the ROUTINE_MODULE global variable is set only for procedures and compiled functions: the value always reflects the name of the currently executing routine.

The value does not change for inline functions or methods: the value remains the same as it was when the inline function or method was invoked.