Issue the following SQL statement:
SELECT 'VERSION=' ,GETVARIABLE('SYSIBM.VERSION') FROM SYSIBM.SYSDUMMY1 ;
---------+---------+
VERSION= DSN09015
---------+---------+
See DB2 SQL Reference for explanations regarding the GETVARIABLE function (and possibilities), and the returned value (DSN09015, in the sample above).