How to check db2 version on Z/OS using only SQL commands?
Thanks, Melita
For DB2
:
"SELECT * FROM SYSIBMADM.ENV_INST_INFO" - SERVICE_LEVEL
In z/OS while on version 10, use of CURRENT APPLICATION COMPATIBILITY
is not allowed. You will have to resort to:
SELECT GETVARIABLE('SYSIBM.VERSION') AS VERSION,
GETVARIABLE('SYSIBM.NEWFUN') AS COMPATIBILITY
FROM SYSIBM.SYSDUMMY1;
Here is a link to all the variables available: https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/sqlref/src/tpc/db2z_refs2builtinsessionvars.html#db2z_refs2builtinsessionvars
Another one in v11:
select CURRENT APPLICATION COMPATIBILITY from sysibm.sysdummy1
Result:
V11R1
It's not the current version, but the current configured level for the application.
There is also the env_inst_info admin view. As with CanSpice I can only vouch for LUW, but there should at least be a similar view available for Z/OS.
SELECT * FROM SYSIBMADM.ENV_INST_INFO
Both worked for me.
SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO());
or
SELECT * FROM SYSIBMADM.ENV_INST_INFO;
SELECT GETVARIABLE(('SYSIBM.VERSION')
FROM SYSIBM.SYSDUMMY1;
-- PPP IS PRODUCT STRING 'DSN'
-- VV IS VERSION NUMBER E.G., 10, 11
-- M IS MAINTENANCE LEVEL E.G. 5
-DISPLAY GROUP
THIS WILL DISPLAY THE LEVEL CM, ENFM, N