IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comman to get active DB2 subsystem


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kowsalya K

New User


Joined: 21 Mar 2014
Posts: 4
Location: India

PostPosted: Thu Apr 10, 2014 2:05 pm
Reply with quote

Hi All,

Can anyone help me with the rexx command to list the active DB2 subsystem's running on mainframe box(To which I'm connected to).


Your help is highly appreciated.


Thanks
Brahma
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Thu Apr 10, 2014 2:57 pm
Reply with quote

Your requirement is a bit vague, but why do you want to do it in Rexx?

How about batch SDSF, for example?
Back to top
View user's profile Send private message
Kowsalya K

New User


Joined: 21 Mar 2014
Posts: 4
Location: India

PostPosted: Thu Apr 10, 2014 3:03 pm
Reply with quote

I'm working on automation of few db2 job based on few user input and it is in Rexx using user interaction. So only need in Rexx.

If in batch how can we do it?

Thanks
Kummu
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 10, 2014 3:53 pm
Reply with quote

Look up the Rexx language reference and you will see that there is no such Rexx 'command'. (Rexx does not have commands - like any other language it has keywords and functions.)

Look in the SQL Language Reference and in particular the Rexx section and you may find something. However, SDSF is probably the better bet so read the about the SDSF/Rexx interface - I guess it will be in the SDSF manuals.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Apr 10, 2014 4:48 pm
Reply with quote

console command "D SSI,STAT=ACT" ?
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Thu Apr 10, 2014 5:24 pm
Reply with quote

If you don't have access to console commands, then you can use the SDSF/Rexx interface (ISFEXEC) to return the results of an SDSF 'DA' command. This will give you a list of all of the tasks running in the system and from there you can figure out which of them are for the DB2 subsystems currently active. (That of course assumes that you have access to the SDSF 'DA' command. I have worked in shops where it wasn't permitted.)
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Tue Apr 15, 2014 4:39 pm
Reply with quote

I've slightly modified a routine of Peter Nancollis called DB2ERLY.
This routines loops through all active tasks and checks whether DSNZPARS is loaded. This approach may not work the most elegant way but does the job.

Code:
/* rexx */
numeric digits 10
cvt=ptr(76)
jesct=ptr(cvt+296)
sscvt=ptr(jesct+24)
do until sscvt = 0
  db2ssid = stg(sscvt+8,4)
  call getcsects
  sscvt=ptr(sscvt+4)
end
exit
getcsects:
if sscvt = 0 then return
erlyprhb=ptr(sscvt+20)
if length(erlyprhb) > 9 then return
erlyeepl=ptr(erlyprhb+76)
eeplents = stg(erlyeepl+8,2)
eeplcent=erlyeepl+32
found = 0
do i = 1 to c2d(eeplents) - 1 until found = 1
   if stg(eeplcent+4,8) = 'DSNZPARS' then found = 1
   if stg(eeplcent+4,3) <> 'DSN' then leave
   eeplcent=eeplcent+32
end
if found then say db2ssid
return
ptr:
return c2d(storage(d2x(arg(1)),4))
stg:
return storage(d2x(arg(1)),arg(2))

Give it a try
Back to top
View user's profile Send private message
Kowsalya K

New User


Joined: 21 Mar 2014
Posts: 4
Location: India

PostPosted: Thu Apr 17, 2014 9:14 am
Reply with quote

Thankyou very much for valuable replies.

I'm able to get the list of active db2 subsystems using code provided by Stefan.

Thanks alot Stefan.
Back to top
View user's profile Send private message
Kowsalya K

New User


Joined: 21 Mar 2014
Posts: 4
Location: India

PostPosted: Thu Apr 17, 2014 11:41 am
Reply with quote

Here I see only one issue, that in a sysplex environment.

For ex:-
3 DB2 subsystem is defined on one L-par in which 2 are not datasharing
and
1 DB2 subsystem is defined on the other L-Par which is datasharing.

If we run the code on second L-Par , we are getting the complete list of subsystem(which are on the first L-Par also).

Looking around if we can get the list of DB2 subsystem which are active/defined on the specific L-par on we are running this code.

Thanks
Kowsalya
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Fri Apr 25, 2014 9:54 am
Reply with quote

You can combine this code of Stefan with REXX /SDSF interface as suggested by Don .
List active tasks with SDSF DA command , and compare it with list of DB2 this way you can build a list of DB2 active on particular Lpar .

Hope this helps .

Regards,
MJ
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Determining Active VM Directory All Other Mainframe Topics 0
No new posts Retrieve IMS SubSystem Name IMS DB/DC 2
No new posts Get name of Subsystem routine is exec... All Other Mainframe Topics 2
No new posts List of Active Jobs in CTRL-M JCL & VSAM 1
No new posts The oldest active mainframe developer? General Talk & Fun Stuff 5
Search our Forums:

Back to Top