0
votes

ROUTINE_SCHEMA or ROUTNE_SPECIFIC_NAME global variables in Db2 LUW can be used to retrieve the schema name or specific name of the currently executing routine.

Is there an alternative for one of them in Db2 z/OS (where both global variables do not seem to exist) ?

2

2 Answers

0
votes

I believe you're out of luck regarding the specific name. You should be able to get the schema out of the CURRENT SCHEMA special register: https://www.ibm.com/support/knowledgecenter/SSEPEK_11.0.0/sqlref/src/tpc/db2z_specialregisterinroutine.html.

0
votes

Could you query the SYSIBM.SYSROUTINES catalog? The SYROUTINES catalog has columns for SCHEMA and SPECIFICNAME: https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/cattab/src/tpc/db2z_sysibmsysroutinestable.html e.g. SELECT SCHEMA, SPECIFICNAME FROM SYSIBM.SYSROUTINES.