Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comman to get active DB2 subsystem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Comman to get active DB2 subsystem
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: 175
Location: UK

PostPosted: Thu Apr 10, 2014 2:57 pm    Post subject:
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    Post subject: Reply to: Comman to get active DB2 subsystem
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: 1714
Location: UK

PostPosted: Thu Apr 10, 2014 3:53 pm    Post subject: Reply to: Comman to get active DB2 subsystem
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: 1278
Location: Belgium

PostPosted: Thu Apr 10, 2014 4:48 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Thu Apr 10, 2014 5:24 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Comman to get active DB2 subsystem
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    Post subject: Reply to: Comman to get active DB2 subsystem
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts JCL to fetch schedule status from act... parasmalik20 CA Products 1 Thu Jun 02, 2016 7:11 pm
No new posts Active module not Found (DSNREXX &... sakrat CLIST & REXX 12 Fri Jun 05, 2015 4:07 pm
No new posts How to connect Remote DB2 subsystem t... jn_sumit CLIST & REXX 15 Fri May 22, 2015 2:16 pm
No new posts REXX to search string in active addre... jackzhang75 CLIST & REXX 4 Fri Jan 09, 2015 10:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us