Author |
Message
|
RogerLacroix |
Posted: Wed Feb 18, 2009 12:03 pm Post subject: How to determine active mainframe QMgrs? |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
All,
Lets say I have 3 QMgrs in an LPAR where any of the 3 may be running (and there is no default QMgr).
How can I determine which QMgr(s) are running in the LPAR from within my program? It could be 1, 2 or all of them.
Is there a control block that I can peek at to see what QMgrs are currently running in the LPAR?
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Feb 18, 2009 12:37 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Check your PM's  |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Feb 18, 2009 6:07 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Try connecting to each one in turn ? _________________ Glenn |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Feb 18, 2009 9:44 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Roger's scenario doesn't assume knowledge of what those QMs are. He sorta wants a dspmq command for z/OS. I think. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Feb 19, 2009 12:56 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
try the "D SSI" command, it shows you all subsystems and whether they are active or not. _________________ Regards, Butcher |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 19, 2009 1:28 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
D SSI would be hard to issue from within a program.
The subsystem name table can be accessed in virtual storage and looped through. I wrote a REXX to do this once.
How would you identify which were the MQ subsystems though?
It also would not necessarily indicate they were actually running as started tasks.
If the program already knows the names of the QMs and wants to check which are running then it's easy to loop through the address space control block chain (ASCB). |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Feb 19, 2009 1:41 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
i was just giving a hint were to start, not a solution _________________ Regards, Butcher |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 19, 2009 4:06 am Post subject: Re: How to determine active mainframe QMgrs? |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
RogerLacroix wrote: |
All,
Lets say I have 3 QMgrs in an LPAR where any of the 3 may be running (and there is no default QMgr).
How can I determine which QMgr(s) are running in the LPAR from within my program? It could be 1, 2 or all of them.
Is there a control block that I can peek at to see what QMgrs are currently running in the LPAR?
Regards,
Roger Lacroix |
Can you query your monitoring software from within your program?
QPasa for instance will give you that information and you didn't even have to run on the mainframe for it...
Another possibility would be to try and access the port via telnet... and remember the result... still don't need to run on the MF for that test...
As you said that you may have more than one running I suppose they would have to run on their own port...
But I doubt that these will give you any information on the LPAR... they are running in.
Well the other thing is that CICS can only be connected to a single qmgr. So why not just call the display qmgr command and retrieve the qmgr name from within CICS... ?
If you are running in batch you could run a CSQUTIL to try to get the qmgr status for each of them... and you should know the names up front... and remember the answer...
The other capabilities have all to do with MF system programing and I leave that to the specialists.
Hope it helped some...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 19, 2009 6:23 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
A REXX script could issue D A,L command to display the active tasks, then parse looking for MSTR or CHIN.
An authorized assembler program could chase through the CVT (communication vector table), then the ASCBs (address space control blocks).
JES has its own api for accessing JES things. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 19, 2009 8:10 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
A quick search of Mr. Google (rexx+mvs+command+parse) coughed up a few interesting items.
kevin2349 offered this: http://www.tek-tips.com/viewthread.cfm?qid=842742&page=7 _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 19, 2009 8:33 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
bruce2359 wrote: |
A REXX script could issue D A,L command to display the active tasks, then parse looking for MSTR or CHIN.
An authorized assembler program could chase through the CVT (communication vector table), then the ASCBs (address space control blocks).
JES has its own api for accessing JES things. |
Actually any program (in any language which allows storage address references) can look through the common storage control blocks, it does not have to be APF authorised or in key zero.
You can even use the REXX storage function to browse through storage. I once wrote a neat storage viewer in REXX and ISPF.
Issuing operator commands from REXX would require operator privileges which most site would not give to MQ developers/admins.
The TSO STATUS command will indicate if a jobname/stc is running.
To give the best advice would require knowing the preferred language and execution environment (batch, TSO, CICS) etc. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Feb 19, 2009 8:58 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
A team mate of mine offered this:
Quote: |
z/OS subsystem names are limited to 4 characters, and a queue manager name will always end in MSTR, the channel initiator (which runs as a seperate task) will always end in CHIN. So if you did an inquiry (JES or MVS command) of active jobs ending in MSTR (or CHIN), the response would return the active qmgrs running in the sysplex. The first 4 characters would be the queue manager name(s).
|
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
zpat |
Posted: Thu Feb 19, 2009 10:19 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Like I said, it is hard for programs to see the results of operator commands (even if they were allowed to issue them).
But it's very easy to scan the ASCB list in storage.
Here is an example of REXX acessing storage:
Code: |
/* REXX : SUBSYSTEM STATUS */
/* */
/* DISPLAY ALL SUBSYSTEM NAMES AND WHICH FUNCTIONS ARE ACTIVE */
/* */
/*******************************************************************/
NUMERIC DIGITS 10 /* ALLOW FOR FULLWORD ADDR */
CVT = ADDC(16,'00') /* FIND CVT */
JESCT = ADDC(CVT,'0128') /* FIND JESCT */
SSCT = ADDC(JESCT,'18') /* FIND SSCT */
DO WHILE (SSCT > 0) /* SEARCH SSCT CHAIN */
NM = STORAGE(D2X(SSCT+8),4)
SAY 'SUBSYSTEM NAME IS ' NM C2X(NM) ' SSCT' D2X(SSCT)
SSVT = ADDC(SSCT,'10') /* FIND SSVT */
IF SSVT > 0 THEN
DO
AL = SSVT + X2D('04') /* OFFSET 4 = FUNC TABLE */
TB = STORAGE(D2X(AL),255) /* TABLE ITSELF, 255 BYTES */
DO J = 1 TO 255
IF SUBSTR(TB,J,1) \= '00'X THEN /* FUNCTION IS ACTIVE */
SAY 'ACTIVE FUNCTION ' J
END
END
ELSE
SAY 'NO SSVT'
SAY ' '
SSCT = ADDC(SSCT,'04') /* FIND NEXT SSCT */
END
EXIT 0
ADDC:ARG AD1,AD2 /* CALC ADDRESS FUNCTION */
RETURN C2D(STORAGE(D2X(AD1+X2D(AD2)),4))
|
To locate the current ASCB addr in REXX
SL = C2D(STORAGE('0224',4)) /* FIND ASCB */
Last edited by zpat on Thu Feb 19, 2009 10:58 am; edited 3 times in total |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Feb 19, 2009 10:30 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
NM = STORAGE(D2X(SSCT+,4) |
What I see is a smiley between (SSCT+ smiley ,4)
What's after the plus sign and before the comma? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 19, 2009 10:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
What's after the plus sign and before the comma? |
It'll be an eight and a right hand bracket  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|