|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MA01 supportpac does not return exact MQRC on AIX7/MQ7.0 ? |
« View previous topic :: View next topic » |
Author |
Message
|
flex_1 |
Posted: Tue Jan 28, 2014 1:07 am Post subject: MA01 supportpac does not return exact MQRC on AIX7/MQ7.0 ? |
|
|
Newbie
Joined: 28 Jan 2014 Posts: 4
|
Hi guys,
I'm using MA01 (v6.0) on a AIX7 box with MQ 7.0 installed. 'Q' util is able to read/write messages from MQ with no issues at all.
But when simulating an error condition (ex. queue get disabled) and then running this 'q' util to get messages, I'm expecting to get a MQRC '2016' in my shell script. But I get something like '224'.
a small fragment of of my shell script(ksh shell) (very crude though)
.....
q -iQ1
echo $?
....
224
When I run the similar script on a windows I get proper MQRC in %ERRORLEVEL%
batch script example
....
q -iQ1
echo %ERRORLEVEL%
...
2016
Am I doing something wrong in the shell script? or do I need to decode this 224 exit code to 2016 somehow?
Please help. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jan 28, 2014 2:30 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Here's a reply that I received from the author some time back (my MQRC was 2058)
Quote: |
Q does return the reason code by default. Unfortunately, current Unixes are restricted to returning values between 0 and 255. See http://en.wikipedia.org/wiki/Exit_status.
This means that you only see the least significant byte of the reason code - 2058 in hex is 80A. First byte is 0A which is 10. I don't know of any way to return the full reason code in a Unix program. You can ask Q to return 0,4,8 based on the reason code by adding parameter -Vc
|
_________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
flex_1 |
Posted: Tue Jan 28, 2014 3:47 am Post subject: |
|
|
Newbie
Joined: 28 Jan 2014 Posts: 4
|
Zpat, Thanks a lot for your comment.
Now that solves the mystery..
So should I covert the given o/p to hex and then trying adding a 0x07 or a 0x08 to it and see if it makes a 20xx number and "assume" it to be that reason code?
something like this..
1:get return_code from 'q' util
2:covert to hex
3:add 0x07 or a 0x08 or a 0x09 @ most significant byte
4:for each output from step 3 , compare with a MQRC code
5: if matched "assume it to be the cause"
that also wont help as 07e0 is a MQRC ,08e0 is another MQRC ..and even 09e0 is a different MQRC.
I'm out of my little wisdom..
How did you manage to tackle it? Will really appreciate if you could suggest a way out. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jan 28, 2014 5:28 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I just used the -Vc option and terminates if RC > 4.
I presume there would be an error message indicating the exact problem in any case? Why not use that?
Any non-zero return code is usually a problem and the exact reason tends to be obvious if you look at the output of the command. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
flex_1 |
Posted: Tue Jan 28, 2014 6:04 am Post subject: |
|
|
Newbie
Joined: 28 Jan 2014 Posts: 4
|
zpat, I finally almost got it working..
I now check the return code. If not zero read the output and get the reason code now.
Thanks a lot for your quick reply.
Appreciate it.  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|