Page 1 of 1

Read MQ Trigger Status

PostPosted: Sun Oct 03, 2010 11:56 am
by rajas.abcdefg
Hi,

Is it possible to get the trigger status of the MQ. i.e. whether the queue is up/down using batch jcl /rexx? If so sample code snippet will be helpful

Thanks
Raj

Re: Read MQ Trigger Status

PostPosted: Mon Oct 04, 2010 10:25 pm
by Bill Dennis
Use CSQUTIL to do commands in batch, including the display command.
//* DISPLAY PRODUCTION MQSERIES QUEUE                         
//PRODSTEP EXEC PGM=CSQUTIL,PARM='qmgr'      <== QMGR SubSYS NAME                     
//SYSPRINT DD SYSOUT=*                               
//* STEPLIBS REQD IF NOT IN LINKLST       
//STEPLIB  DD DSN=hlq.SCSQAUTH,DISP=SHR  <= AUTH PGMS     
//         DD DSN=hlq.SCSQLOAD,DISP=SHR  <= UTIL PGMS     
//         DD DSN=hlq.SCSQANLE,DISP=SHR  <= MSGS         
//SYSIN    DD *                                             
    DISPLAY QUEUE(qname      )    ALL     

Re: Read MQ Trigger Status

PostPosted: Sat Oct 09, 2010 11:01 am
by rajas.abcdefg
Hi Bill,

I tried executing the code snippet by changing the PGMs and QMGR, the job had failed with the below message

CSQU000I CSQUTIL IBM WebSphere MQ for z/OS V6
CSQU001I CSQUTIL Queue Manager Utility - 2010-10-08 14:56:53
DISPLAY QUEUE(HP.QMG.MQ.IN45) ALL
CSQU106E Invalid function DISPLAY
CSQU147I CSQUTIL Utility terminated, return code=12

Please help me

Re: Read MQ Trigger Status

PostPosted: Mon Oct 11, 2010 9:14 pm
by Bill Dennis
Try this version where the SYSIN points to the command on a different DD.
//* DISPLAY PRODUCTION MQSERIES QUEUE                         
//PRODSTEP EXEC PGM=CSQUTIL,PARM='qmgr'      <== QMGR SubSYS NAME                     
//SYSPRINT DD SYSOUT=*                               
//* STEPLIBS REQD IF NOT IN LINKLST       
//STEPLIB  DD DSN=hlq.SCSQAUTH,DISP=SHR  <= AUTH PGMS     
//         DD DSN=hlq.SCSQLOAD,DISP=SHR  <= UTIL PGMS     
//         DD DSN=hlq.SCSQANLE,DISP=SHR  <= MSGS         
//SYSIN    DD *                                             
COMMAND DDNAME(CMDINP) 
/*                     
//CMDINP   DD *       
DISPLAY QUEUE(qname      )    ALL     

Re: Read MQ Trigger Status

PostPosted: Tue Nov 02, 2010 10:32 pm
by noggin
For 4GLs ie. Cobol, PL/1, Natural etc. you can get the trigger information programmatically by calling the MQINQ API passing the appropriate attribute selectors -

attribute selector MQIA-TRIGGER-TYPE (integer value 24) will return 1 for First, 2 for Every, 3 for Depth
attribute selector MQIA-TRIGGER-CONTROL (integer value 28) will return 0 for trigger OFF, 1 for trigger ON

You should be able to do something similar in REXX using RXMQINQ but only one attribute can be inquired upon at a time.

Either way you will have to first open the queue manager for inquiry by calling MQOPEN (RXMQOPEN in REXX) to get an object handle.

Re: Read MQ Trigger Status

PostPosted: Tue Nov 02, 2010 11:31 pm
by NicC
PL/1 & COBOL are 3rd generation languages

Re: Read MQ Trigger Status

PostPosted: Wed Nov 03, 2010 2:42 pm
by noggin
Ha, yes you're quite right! :?