Author |
Message
|
Umeshrath |
Posted: Wed Apr 26, 2006 10:26 am Post subject: Issue in MQ inquire |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
Hi,
I am trying to do an MQINQUIRE in batch enviornment.
My requirement is to know the current depth of the queue.
I opened the queue with
Open Para.
MOVE MQOO-INQUIRE TO WS-MQ-FUNCTION
COMPUTE WS-MQ-OPEN-OPTIONS = MQOO-INPUT-SHARED
+ MQOO-FAIL-IF-QUIESCING
+ WS-MQ-FUNCTION
END-COMPUTE
MOVE 'HSSERR' TO LS-MQ-OBJECT-NAME
MOVE LS-MQ-OBJECT-NAME TO WS-MQ-OBJECT-NAME
MOVE MQOT-Q TO MQOD-OBJECTTYPE
MOVE WS-MQ-OBJECT-NAME TO MQOD-OBJECTNAME
CALL WS-MQOPEN USING WS-MQ-CONN-HANDLE
WS-MQ-OBJECT-DESCRIPTOR
WS-MQ-OPEN-OPTIONS
WS-QUEUE-OBJECT-HANDLE
WS-MQ-COMPLETION-CODE
WS-MQ-REASON-CODE
END-CALL
MQ ENQUIRE PARA.
MOVE MQOT-Q TO MQOD-OBJECTTYPE
MOVE WS-MQ-OBJECT-NAME TO MQOD-OBJECTNAME
MOVE MQIA-CURRENT-Q-DEPTH TO MQ-INQRY-OPTION3
MOVE WS-MQINQ TO MQ-DSPL-FUNC
CALL WS-MQINQ USING WS-MQ-CONN-HANDLE
WS-MQ-CONN-HANDLE
MQ-INQRY-OPTIONS-CNT
MQ-INQRY-OPTIONS
WS-INQRY-INTATTR-CNT
WS-INQRY-INTATTRS
WS-INQRY-CHAR-LENGTH
WS-INQRY-CHARS
WS-MQ-COMPLETION-CODE
WS-MQ-REASON-CODE
I am not getting the queue depth. It is coming as zero.
Regards,
Umesh _________________ Umesh Rath |
|
Back to top |
|
 |
wschutz |
Posted: Wed Apr 26, 2006 10:40 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
So are MQ-INQRY-OPTIONS-CNT and WS-INQRY-INTATTR-CNT set to "1"? _________________ -wayne |
|
Back to top |
|
 |
Umeshrath |
Posted: Wed Apr 26, 2006 7:31 pm Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
Yes. _________________ Umesh Rath |
|
Back to top |
|
 |
JoePanjang |
Posted: Thu Apr 27, 2006 12:15 am Post subject: |
|
|
Voyager
Joined: 10 Jul 2002 Posts: 88 Location: Dengkil MALAYSIA
|
Any compcode / reason code?
'MQOPEN' call missing MQOD-OBJECTQMGRNAME? No QMGR name being pass?
I did code the same COBOL pgm 10 years ago in v1.2 and until today it's still running(v5.3). I'm using NAMELIST to store all the queues to be checked during SOD. _________________ Every good deed is charity... |
|
Back to top |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 2:05 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
What type of queue are you opening? qlocal? cluster queue definition? model queue? shared queue?... and, the obvious question...are you sure there are actualy messages on the queue? _________________ -wayne |
|
Back to top |
|
 |
Umeshrath |
Posted: Thu Apr 27, 2006 6:12 am Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
I am opening a local queue and there are records in the queue.
The reason code is 2 and completion code is zero but the depth is showing as zero. _________________ Umesh Rath |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Apr 27, 2006 8:10 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Which call is actually failing? The MQINQ? |
|
Back to top |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 8:43 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Umeshrath wrote: |
The reason code is 2 and completion code is zero .... |
That seems unlikely. Its more like that the compcode is 2 and there is a non-zero reason code. As Kevin asks, which call is getting this? The mqopen or the mqinq? _________________ -wayne |
|
Back to top |
|
 |
Umeshrath |
Posted: Thu Apr 27, 2006 8:59 am Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
MQINQ call. MQOPEN is successful. _________________ Umesh Rath |
|
Back to top |
|
 |
JoePanjang |
Posted: Thu Apr 27, 2006 4:42 pm Post subject: |
|
|
Voyager
Joined: 10 Jul 2002 Posts: 88 Location: Dengkil MALAYSIA
|
update the code to display the completion / reason code. your MQ-INQRY-OPTION3 is defined in MQ-INQRY-OPTION? _________________ Every good deed is charity... |
|
Back to top |
|
 |
wschutz |
Posted: Thu Apr 27, 2006 4:55 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
At this point , you might be better off taking one of the three MQINQ cobol samples and modifying that to do what you need: amqminqx amqiinqx amqvinqx. They do an inquire on the current depth of a queue. _________________ -wayne |
|
Back to top |
|
 |
Umeshrath |
Posted: Thu Apr 27, 2006 6:44 pm Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
From Where i will get the sample codes? _________________ Umesh Rath |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Apr 27, 2006 6:52 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
I believe you need to look in hlq.SCSQCOBS where hlq is probably SYS1
You could also always read the APG I think there are some samples in there too. |
|
Back to top |
|
 |
Umeshrath |
Posted: Thu Apr 27, 2006 7:37 pm Post subject: |
|
|
Novice
Joined: 27 Dec 2005 Posts: 23 Location: Hyderabad
|
Hi Kevin,
Can you provide me the link for APG or a hint where i will find that.
Regards,
Umesh _________________ Umesh Rath |
|
Back to top |
|
 |
wschutz |
Posted: Fri Apr 28, 2006 1:27 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
|
Back to top |
|
 |
|