Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2011
    Posts
    24

    Question Unanswered: Session Id for DB2 Z/OS

    Hi ,
    Database server = DB2 z/OS 10.1.5

    What would be the command to get the session id (or is it called something else in DB2) in DB2 Z/OS.
    Came across the query "select application_id() as appl_id from sysibm.sysdummy1" but this does not seem to be supported in Z/os.
    (No authorized routine named "APPLICATION_ID" of type "APPLICATION_ID")

    Thanks.

  2. #2
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    No, there is no such function (nor any other way to obtain a unique session value) in DB2 for z/OS.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  3. #3
    Join Date
    Nov 2011
    Posts
    24

    Question

    Oh. Surprised.
    But DB2 LUW does have session id values?
    Using a Connection's Application ID

  4. #4
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Yes; see also the DB2 Info Center for LUW:
    APPLICATION_ID scalar function
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You may have a good chance to do something similar as I described in my article using a UDF on DB2 z/OS. The DBINFO structure, which is available using the DBINFO keyword on the CREATE FUNCTION statement, contains an application ID also on z/OS. So the article is pretty much applicable for you.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  6. #6
    Join Date
    Nov 2011
    Posts
    5

    Hi all

    We can get session id in DB2 zO/S.

    In DB2 zO/S it is called as SESSID

    Use the following command to get SESSID:

    -DISPLAY THREAD(*) LOCATION(*) DETAIL

    From the O/P look this message DSNV448I..

    The information on this line is part of message DSNV448I. The SESSID
    column has changed. If the connection uses VTAM, the SESSID column
    contains a VTAM session identifier. If the connection uses TCP/IP, the
    SESSID column contains "local:remote", where local specifies the DB2
    TCP/IP port number and remote specifies the partner's TCP/IP port
    number.

  7. #7
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    Take a look at special registers. The one you want is in there.

  8. #8
    Join Date
    Nov 2011
    Posts
    24
    Quote Originally Posted by dineshdb2dba View Post
    We can get session id in DB2 zO/S.

    In DB2 zO/S it is called as SESSID

    Use the following command to get SESSID:

    -DISPLAY THREAD(*) LOCATION(*) DETAIL

    From the O/P look this message DSNV448I..
    Where exactly should the statement "-DISPLAY THREAD(*) LOCATION(*) DETAIL" be executed? Tried it in the AQT Run window where I normally execute queries.Didn't recognize.

  9. #9
    Join Date
    Nov 2011
    Posts
    5
    Where exactly should the statement "-DISPLAY THREAD(*) LOCATION(*) DETAIL" be executed? Tried it in the AQT Run window where I normally execute queries.Didn't recognize.

    -DISPLAY THREAD(*) LOCATION(*) DETAIL

    This command can be issued from a z/OS console,
    a DSN session under TSO,
    a DB2I panel (DB2 COMMANDS),
    an IMS or CICS terminal, or
    a program using the
    instrumentation facility interface (IFI).

    Data sharing scope: Group or local, depending on the SCOPE option.

  10. #10
    Join Date
    Nov 2011
    Posts
    24
    Hmm... IBM Data Studio's(2.2.1.1) SQL Scripts window could not recognize the command.
    ILLEGAL SYMBOL "DISPLAY"

  11. #11
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by techday View Post
    Where exactly should the statement "-DISPLAY THREAD(*) LOCATION(*) DETAIL" be executed?
    Simplest way: on the DB2I panel (ISPF), option 7.
    Alternative: as DSN subcommand, either on the TSO prompt or through JCL:

    Code:
    //DB2CMD  EXEC PGM=IKJEFT01,DYNAMNBR=20
    //SYSTSPRT DD  SYSOUT=*
    //SYSPRINT DD  SYSOUT=*
    //SYSUDUMP DD  SYSOUT=*
    //SYSTSIN  DD  *
       DSN SYSTEM(DB2A)
       -DISPLAY THREAD(*) LOCATION(*) DETAIL
      END
    //*
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

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