Author |
Message
|
Vitor |
Posted: Tue Aug 21, 2007 4:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
Vitor wrote: |
jefflowrey wrote: |
Vitor - The OK is a problem because MQGET does not do that. It only returns a 2033 when CompCode is MQCC-FAILED.
|
Things you learn! I'd always believed that CompCode and ReasonCode were populated separately. But do agree that 2033 should be associated with a "failed" completion code rather than an OK |
If you look in the APR, on the MQGET... it clearly documents what RCs can be returned with which CCs...  |
Oh that I'd seen and often commented that 2033 is an odd one as it's not always a failure, sometimes it's just an indication you're done (described as an end of file marker elsewhere in this post I think). What I didn't realise was that one was dependant on the other; codes like 2033, 2085, etc are not returned unless CC is set to failed.
I'll confess here & now I don't always check CC in my code; I check RC and act as required. If the 2085 I make the (perhaps false) assumption that the CC will tell me something bad has happened....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 21, 2007 5:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't usually bother with CompCode either.
But clearly something is going wrong, somewhere, in mk.gupta's code if it's returning a CompCode=0 for a ReasonCode=2033. At least, one hopes it's in mk.gupta's code and not elsewhere... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 21, 2007 5:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And it was on this basis I asked the question "why is OK a problem?" If you've got a 2033 in reason code you know it's an issue.
jefflowrey wrote: |
At least, one hopes it's in mk.gupta's code and not elsewhere... |
Of course, if this style of coding is widespread, it does raise the interesting possibility that MQ's been returning MQCC-OK for failures since v5.0 and no-one's noticed.....
(I suspect this coffee's been spiked. With caffine.... ) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Aug 21, 2007 5:44 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
How do you know you are getting an OK response.
Code: |
PERFORM 4000-CALL-ESMQUTIL 00080100
THRU 4000-EXIT. 00080100
00080300
C2615 IF ESMQ-REASON = 2033
C2615 SET WS-CMDATA-DONE TO TRUE
C2615 GO TO 3200-EXIT
C2615 END-IF. |
The first thing you do, is check for a 2033 and then bail. You don't get as far as checking the CC.
As others have said, it looks like a message with a matching CorrelID has not been found, either because you haven't waited long enough for the message, of the sending application didn't set the CorrelID correctly.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Aug 21, 2007 7:24 am Post subject: |
|
|
Guest
|
A more elegant method: following each MQI call test for Completion Code not equal to MQCC_OK; then test for all of the MQRC_ reason codes that seem important to your application. The APR contains the list of all the not MQCC_OK for each MQI call. How about queue full? Or put-inhibited? There are other things to test for.
Also, the MQ installation provides copybooks (include files) that contain the logical value MQRC_NO_MSG_AVAILABLE. Don't test for 2033; rather, test for the logical equivalent.
GO TO's in your code? Which compiler? Which platform? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 21, 2007 7:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
A more elegant method: following each MQI call test for Completion Code not equal to MQCC_OK; |
Or as discussed above, ReasonCode not equal to zero. Which would help fix this problem. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Aug 21, 2007 7:49 am Post subject: |
|
|
Guest
|
Quote: |
ReasonCode not equal to zero |
In this MQGET call instance, sure.
But in the grander scheme (and a better best practice) a non-zero reason code might be valid for the application.
As an example: Program A MQCONNects to the qmgr; then calls sub-Program B to do gets or puts or whatever. Sub-Program B MQCONNs and receives a MQCC_WARNING with non-zero reason code MQRC_ALREADY_CONNECTED. This would be valid for the application.
Reason codes are not (necessarily) error codes. A non-zero reason code is not necessarily an error. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Aug 21, 2007 12:06 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
Reason codes are not (necessarily) error codes. A non-zero reason code is not necessarily an error. |
Quite so. As I said, a 2033 is quite often not an error. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|