Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Location
    New York City
    Posts
    2

    Unanswered: Help - Need to get DB2 version info via SQL

    I'm hoping someone can help me determine the DB2 version running on an MVS host. I have access to the DB2 panels and spufi but have not been able to determine anything more than it is version 7 or later (SYSIBM.SYSCOLDIST_HIST is present and populated).

    I tried something I found on the db2luw site but no luck:

    SELECT service_level, fixpack_num FROM TABLE
    (sysproc.env_get_inst_info())
    as INSTANCEINFO"

    SQL0440N No function by the name "SYSPROC.ENV_GET_INST_INFO" having compatible arguments was found in the function path. SQLSTATE=42884


    Thanks in advance,

    Chris
    Last edited by ChrisNees; 03-16-07 at 16:42.

  2. #2
    Join Date
    Dec 2005
    Posts
    273
    Try to issue a -DIS GROUP command.

    you'll see something like this:
    BEGIN DISPLAY OF GROUP(xxxxx ) GROUP LEVEL(810) MODE(N)

    GROUP LEVEL is the DB2 - version
    MODE is the modus: C=compatibility mode, N=new funcion mode, E=enabling new funcion mode

  3. #3
    Join Date
    Mar 2007
    Location
    New York City
    Posts
    2

    Thanks but I need SQL solution

    Thanks but I don't have access to any DBA utilities. I'm barred by RACF from issuing even display commands. It looks like I'm limited to SQL.
    Last edited by ChrisNees; 03-19-07 at 12:03.

  4. #4
    Join Date
    Dec 2005
    Posts
    273
    Then try to access table SYSIBM.SYSDUMMYE
    ( By default that table is created in V8 Compatibility mode ).

    If it exists, you are in V8.

    Next access SYSIBM.SYSTABLES
    if NAME and CREATOR are both VARCHAR(128), then that DB2 is V8 NFM,
    otherwise NAME is VARCHAR(18) and CREATOR is CHAR(8)


    Another approach:
    Try any SQL, that's valid in V8 NFM only.
    e.g.
    SELECT IBMREQD, ( SELECT IBMREQD FROM SYSIBM.SYSDUMMY1 )
    FROM SYSIBM.SYSDUMMY1

    If you receive an syntax error, that DB2 is V7,
    if you receive SQLCODE -4700, that DB2 is V8 CM,
    if execution is successfull, that DB2 is V8 NFM.

    ( caution: that does not work, if you are INSTALL SYSADM. Those users do not get SQLCODE -4700, but may execute that statements in V8 CM )
    Last edited by umayer; 03-20-07 at 04:07.

  5. #5
    Join Date
    Jul 2004
    Posts
    306
    I just ran

    Code:
    SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as x
    and it returned the correct information. I couldn't get your code to work (I only changed the INSTANCEINFO" to an x)

    So if you can't run what I just ran then I think that suggests you are on v7 as that stored proc is new to 8.....

  6. #6
    Join Date
    Dec 2005
    Posts
    273
    @ meehange,

    you ran that statement on DB2 for z/OS ?

    I receive an error when I try to execute it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •