|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Quick Perl Question |
« View previous topic :: View next topic » |
Author |
Message
|
jslabaugh |
Posted: Mon Apr 08, 2002 8:35 am Post subject: |
|
|
Newbie
Joined: 07 Apr 2002 Posts: 1
|
I have a script that is failing to instantiate a new queue manager object. I am able to grab the failure code (2035 in this instance) that is being handed back, but am having trouble mapping that code to text within my script. I'd like to be able to report something a bit more descriptive than "MQCONN failed (Reason = 2035)" to place in my logging routines. 2035? Yeah, great. Let me run off to IBM's site and track that code right down. Any suggestions? There has to be a way to access the code-to-text routines without successfully creating the queue manager object. Any/all suggestions are appreciated. Thanks in advance... |
|
Back to top |
|
 |
jhalstead |
Posted: Mon Apr 08, 2002 9:05 am Post subject: |
|
|
 Master
Joined: 16 Aug 2001 Posts: 258 Location: London
|
Support pack MA0K provides C & VB code for this exact function. I'm sure the standard sample program, once compiled, takes a reason code at the command line and returns a little bit of descriptive text. This should be okay to use from a script.
Jamie |
|
Back to top |
|
 |
bduncan |
Posted: Mon Apr 08, 2002 3:49 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Yes, it is available through the Perl API.
There should be a "ReasonMacro.pl" file which is part of the MQ-perl API distribution (at least as of the latest version 1.17) which contains a hash called %ReasonMacro. It is part of the MQSeries::Constants package, so you should be able to reference it through this. Anyway, it consists of key value pairs like:
2035 => "MQRC_NOT_AUTHORIZED"
So you should be able to pass whatever reason code you get (like 2035) to the hash and ask what value is associated with it, and you should get "MQRC_NOT_AUTHORIZED" back...
Hmm, actually now that I've snooped it looks like the author of the API provided a function to do the reason to text conversion. Consult the man page MQSeries::Command for details... It appears to be the MQSeries::Command->ReasonText function...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
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
|
|
|
|