ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » How to determine active mainframe QMgrs?

Post new topic  Reply to topic Goto page Previous  1, 2
 How to determine active mainframe QMgrs? « View previous topic :: View next topic » 
Author Message
bruce2359
PostPosted: Thu Feb 19, 2009 10:43 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

like this?
N M = S T O R A G E ( D 2 X ( S S C T + 8 ) , 4 )
without the spaces.
_________________
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
View user's profile Send private message
zpat
PostPosted: Thu Feb 19, 2009 11:01 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Here's some assembler code to scan the ASVT (address space vector table) looking for the names of running address spaces.

Code:
        L     R6,PSATOLD-PSA            CURRENT TCB ADDRESS
         L     R6,TCBTIO-TCB(R6)         TIOT ADDRESS (STC NAME)
         L     R8,CVTPTR                 CVT
         L     R8,CVTASVT-CVT(,R8)       ASVT
         CLC   =CL4'ASVT',ASVTASVT-ASVT(R8)   CORRECT EYE?
         BNE   SETPGMP                   CARRY ON IF NOT
         L     R4,ASVTMAXU-ASVT(,R8)     MAX NUMBER OF ASIDS
         SLL   R4,2                      TIMES 4 (EACH 4 BYTES)
         LA    R4,ASVTENTY-ASVT(R4,R8)   END OF ASCB ADDR TABLE
         LA    R8,ASVTENTY-ASVT(,R8)     START OF ASCB ADDR TABLE
LOOPAS   EQU   *
         CR    R8,R4                     END OF TABLE?
         BNL   SETPGMP                   OK, CONT
         TM    0(R8),ASVTAVAL            ASID AVAILABLE?
         BO    NEXTAS                    NO
         L     R3,0(,R8)                 -> ASCB
         CLC   0(4,R3),=CL4'ASCB'        IS IT OK
         BNE   NEXTAS                    NO
         L     R5,ASCBJBNS-ASCB(,R3)     STC NAME POINTER
         LTR   R5,R5                     IS THERE ONE?
         BZ    NEXTAS                    NO
         CLC   0(8,R5),0(R6)             IS IT ME ****
         BNE   NEXTAS                    NO
         CLI   MEFLAG,C'Y'               AGAIN?
         BE    TOOMANY                   YES
         MVI   MEFLAG,C'Y'               SET FLAG FOR FOUND ONCE
NEXTAS   EQU   *
         LA    R8,4(,R8)                 NEXT ASCB ->
         B     LOOPAS                    ASCB LOOP
TOOMANY  EQU   *


Where I have marked **** R5 points to the current address space name (8 chars long) in the loop.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Thu Feb 19, 2009 12:18 pm    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

This should list active and inactive queue manager address spacesl for you.

Code:
MQVER    TITLE 'MQVER - Display MQ subsystems'                                 
MQVER    AMODE 31                                                               
MQVER    RMODE ANY                                                             
MQVER    CSECT                                                                 
         BAKR  R14,R0                 Linkage stack                             
         LAE   R12,0(R15,0)           Set R12 as base register ...             
         USING MQVER,R12              ... and address it                       
         STM   14,12,12(13)           Save callers registers                   
         LR    15,13                  Load R15 with there area                 
         BAS   13,PRGMSAVE+END_EYECATCHER Skip around eyecatcher               
PRGMSAVE DC    18F'0'                                                           
*                                                                               
**       Assembly Information Follows                                           
*                                                                               
BSLCSECT DC    CL8'MQVER   '          ****  CSECT name   ****                   
BSLMODV  DC    CL8'1.0'               ****  Version Info ****                   
         DC    CL24'WRITTEN BY K E FERGUSON '                                   
         DC    CL24'COPYRIGHT - Freeware    '                                   
BSLASMD  DC    CL8'12/21/05'          **** Assemble date ****                   
BSLASMT  DC    CL6' 13.16'            **** Assembly time ****                   
END_EYECATCHER EQU *-PRGMSAVE                                                   
         ST    13,8(15)               Setup save area crossing                 
         ST    15,4(13)               Setup save area crossing                 
*                                                                               
**       End of entry code                                                     
*                                                                               
         L     R5,CVTPTR              Point to CVT ...                         
         USING CVT,R5                 ... and establish addressability         
         L     R11,CVTJESCT           Get CVT entry for JESCT ...               
         USING JESCT,R11              ... and address it                       
         DROP  R5                     Finished with CVT                         
         L     R5,JESSSCT             Get SSCT address ...                     
         USING SSCT,R5                ... and establish addressability         
SSCT_Loop DS   0H                                                                 
         CLC   SSCTID,=C'SSCT'        Make sure we point to SSCT               
         BNE   Logic_error            Error out if we don't                     
         L     R6,SSCTSUSE            Load user area                           
         LTR   R6,R6                  Do we have one?                           
         BZ    Next_SSCT              No - branch to step up SSCT               
         TM    SSCTSUSE,b'10000000'   Is the SSCTSUSE usable?                   
         BO    Next_SSCT              No - branch to step up SSCT               
         CLC   4(4,R6),=C'ERLY'       Is it early load code?                   
         BNE   Next_SSCT              No - branch to step up SSCT               
         CLC   84(8,R6),=C'CSQ3EPX '  Is it MQ Series early load?               
         BNE   Next_SSCT              No - branch to step up SSCT               
         MVC   Wtp_MSQ+17(4),SSCTSNAM Move name to Write to Op                 
         MVC   Wtp_MSQ+8(8),=C'  Active'                                       
         L     R7,SSCTSSVT            Get the SSVT address                     
         L     R3,4(R7)                                                         
         LTR   R3,R3                  Do we have one?                           
         BNZ   SubSys_Active          Yes - Subsystem is active                 
         MVC   Wtp_MSQ+8(8),=C'Inactive'                                       
SubSys_Active DS  0H                                                             
         L     R7,128(R6)             Get the RIB address                       
         MVC   Wtp_MSQ+34(8),25(R7)   Move version number to WTO               
         MVC   Wtp_MSQ+47(7),60(R7)   Move last PTF to WTO                     
         XR    R8,R8                  Clear R8                                 
         ICM   R8,b'0001',33(R7)      Load first byte                           
         BAS   R10,Convert            Convert it to printable ...               
         MVC   Wtp_MSQ+59(3),BSLSAV2+5 ... and move it to WTO                   
         XR    R8,R8                  Clear R8                                 
         ICM   R8,b'0001',34(R7)      Load second byte                         
         BAS   R10,Convert            Convert it to printable ...               
         MVC   Wtp_MSQ+63(3),BSLSAV2+5 ... and move it to WTO                   
Wtp_MSQ  WTO   '  Active xxxx - MQ Subsys xxxxxxxx PTF xxxxxxx LVL xxx.X       
               xxx'                                                             
Next_SSCT DS   0H                                                               
         L     R5,SSCTSCTA            Next SSCT                                 
         LTR   R5,R5                  Do we have one?                           
         BNZ   SSCT_Loop              Yes - Process it                         
         XR    R15,R15                Set condition code to 0 ...               
         PR                           ... and exit program                     
Logic_Error DS  0H                                                               
         MVC   Wtp_Logic+8(4),SSCTID  Put what we found into WTO ...           
Wtp_Logic WTO  'xxxx found where SSCT should be'  ... issue WTO ...             
DUMPER   EX    R15,DUMPER             ...and then ABEND S0C3                   
Convert  DS    0H                                                               
         ST    R8,BSLSAV1             Save passed number in R8                 
         LA    R8,BSLSAV1             Get the save area address                 
         UNPK  BSLSAV2+0(9),0(5,R8)   Convert it to printable                   
         NC    BSLSAV2+0(8),=8X'0F'   Force in pack digit...                   
         TR    BSLSAV2+0(8),=CL16'0123456789ABCDEF' ..and convert it           
         BR    R10                                                             
BSLSAV1  DS    F                      Save area for supplied number             
BSLSAV2  DS    CL9                    Temporary save area for convert           
***********************************************************************         
*                         REGISTER EQUATES                            *         
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *         
R0       EQU   0                                                      *         
R1       EQU   1                                                      *         
R2       EQU   2                                                      *         
R3       EQU   3                                                      *         
R4       EQU   4                                                      *         
R5       EQU   5                                                      *         
R6       EQU   6                                                      *         
R7       EQU   7                                                      *         
R8       EQU   8                       R E G E Q S                    *         
R9       EQU   9                                                      *         
R10      EQU   10      EQUATE PREFIX TO NUMERIC SYMBOLS IN ORDER      *         
R11      EQU   11       TO MAKE THE USE OF REGISTER OPERANDS IN       *         
R12      EQU   12       INSTRUCTIONS SELF EXPLANITORY.THIS ALSO       *         
R13      EQU   13         CREATES ENTRIES IN CROSS REFERENCE.         *         
R14      EQU   14                                                     *         
R15      EQU   15                                                     *         
         LTORG                                                                 
         IEFJSCVT                                                               
         CVT   DSECT=YES                                                       
         IEFJESCT TYPE=DSECT                                                   
         END MQVER                                                             
         PUNCH ' MODE AMODE(31)'   Binder AMODE statement.                     
         PUNCH ' MODE RMODE(ANY)'  Binder RMODE statement.                     
         PUNCH ' ENTRY MQVER'      Binder Module entry point.                   
         PUNCH ' NAME MQVER(R)'    BINDER MODULE NAME.                         
         END ,                     END OF BINDER INPUT.                         
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Feb 19, 2009 3:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Thanks Kevin.

The code sample looks good. I'll port it to C code (unless someone has already done it, and wants to share it).

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Mr Butcher
PostPosted: Thu Feb 19, 2009 9:01 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

why C? Its Assembler, the best thing it can ever become ....
_________________
Regards, Butcher
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Feb 20, 2009 12:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Mr Butcher wrote:
why C? Its Assembler, the best thing it can ever become ....


Assembler? Run away, run away.....

Mind you, if you are (glup) going to write Assembler, z/OS is the platform to do it on.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Fri Feb 20, 2009 1:24 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

of course i do that on z/OS..... and for that specific piece of code posted ..... why translate it ot C? It can not be used on Unix or Windows... so it is perfect for z/OS....
_________________
Regards, Butcher
Back to top
View user's profile Send private message
cschneid
PostPosted: Fri Feb 20, 2009 6:17 am    Post subject: Reply with quote

Novice

Joined: 22 Mar 2005
Posts: 13

Um. The documentation for the SSCVT (the control blocks you're chaining through to find your MQ subsystem) reads in part

Code:

   Pointed to by:        - JESSSCT field of the JESCT data area
                         - SSCTSCTA field of the SSCVT data area
   Serialization:        The SSCVT should be accessed only through
                         the services provided by the IEFSSI macro.

You might want to look into that IEFSSI macro instead of following a chain from a field defined as non-GUPI (see the documentation for the JESCT control block). I speak as one who has in the past and is currently engaged in fixing old code that uses non-GUPI fields.

Sorry, I've never used the IEFSSI macro so I can't provide any educated insight there. But strangely that doesn't stop me from suggesting you use it.

I don't mean to cast aspersions on Kevin's code (frankly, it's refreshing to see someone using the mapping DSECTs). This is really about IBM's interfaces. Perhaps it's time for a SHARE requirement to provide (say) an LE callable service returning information about available subsystems.

Not everyone is as shy as I am about GUPI vs. non-GUPI. As I say, I'm the guy who's had to fix this stuff when someone in 1974 went to offset 32 in the JMR to get the address of the JCT so they could go to offset 88 in that control block to get the 3-byte job number.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Sun Feb 22, 2009 4:24 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Mr Butcher wrote:
why C? Its Assembler

Because I prefer to write C code. I can do assembler just fine but I prefer C.

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Mr Butcher
PostPosted: Sun Feb 22, 2009 11:07 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

never mind , of course c is fine too,
_________________
Regards, Butcher
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » How to determine active mainframe QMgrs?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.