ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Quick Perl Question

Post new topic  Reply to topic
 Quick Perl Question « View previous topic :: View next topic » 
Author Message
jslabaugh
PostPosted: Mon Apr 08, 2002 8:35 am    Post subject: Reply with quote

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
View user's profile Send private message
jhalstead
PostPosted: Mon Apr 08, 2002 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bduncan
PostPosted: Mon Apr 08, 2002 3:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Quick Perl Question
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.