View previous topic :: View next topic
|
Author |
Message |
Kowsalya K
New User
Joined: 21 Mar 2014 Posts: 4 Location: India
|
|
|
|
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 |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
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 |
|
|
Kowsalya K
New User
Joined: 21 Mar 2014 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
console command "D SSI,STAT=ACT" ? |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
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 |
|
|
Kowsalya K
New User
Joined: 21 Mar 2014 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Kowsalya K
New User
Joined: 21 Mar 2014 Posts: 4 Location: India
|
|
|
|
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 |
|
|
mjadwani2785
New User
Joined: 28 Apr 2009 Posts: 89 Location: Noida , Dublin
|
|
|
|
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 |
|
|
|