If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Session Id for DB2 Z/OS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-11, 04:18
techday techday is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
Question 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.
Reply With Quote
  #2 (permalink)  
Old 11-20-11, 15:46
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
  #3 (permalink)  
Old 11-21-11, 04:16
techday techday is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
Question

Oh. Surprised.
But DB2 LUW does have session id values?
Using a Connection's Application ID
Reply With Quote
  #4 (permalink)  
Old 11-21-11, 11:49
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
  #5 (permalink)  
Old 11-28-11, 11:16
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #6 (permalink)  
Old 11-28-11, 12:08
dineshdb2dba dineshdb2dba is offline
Registered User
 
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.
Reply With Quote
  #7 (permalink)  
Old 11-28-11, 13:29
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
Take a look at special registers. The one you want is in there.
Reply With Quote
  #8 (permalink)  
Old 11-29-11, 00:26
techday techday is offline
Registered User
 
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.
Reply With Quote
  #9 (permalink)  
Old 11-29-11, 02:58
dineshdb2dba dineshdb2dba is offline
Registered User
 
Join Date: Nov 2011
Posts: 5
Quote:
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.
Reply With Quote
  #10 (permalink)  
Old 12-05-11, 02:28
techday techday is offline
Registered User
 
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"
Reply With Quote
  #11 (permalink)  
Old 12-05-11, 02:48
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
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/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On