LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2007, 03:26 AM   #1
girish_hilage
Member
 
Registered: Oct 2003
Posts: 78

Rep: Reputation: 15
ibm mq series


I have one query regarding ibm mq series:

To open the MQ series queue I am using the API as follows:
MQOPEN (HCon, &od, MQOO_OUTPUT, &HObj, &CompCode, &Reason);

In "CompCode" it returns if the function is succeeded or not and in the "Reason" it returns the reason code specifying the reason.

But the problem is "Reason" is an integer but I want the actual reason in the string format i.e. actual error text (e.g. error string like "File not found").

So, does anybody know any function in IBM MQ series (just like perror()) to convert the "Reason" code to the actual error text?

Regards,
Girish

Last edited by girish_hilage; 01-03-2007 at 05:01 AM.
 
Old 01-03-2007, 10:03 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

AFAIK, there is no equivalent of "perror ()" for IBM MQSeries. But it shouldn't be difficult to write one for yourself. The documentation you would need is on-line here:
Websphere MQ Application Programming Reference

'Hope that helps .. PSM
 
Old 01-05-2007, 05:48 AM   #3
girish_hilage
Member
 
Registered: Oct 2003
Posts: 78

Original Poster
Rep: Reputation: 15
Do you mean,

void mq_perror (int reason_code, char *reason_string, int n)
{
switch (reason_code)
{
case MQRC_Q_MGR_NOT_AVAILABLE :
strncpy (reason_string, n, "Queue Manager not Available");
break;

case MQRC_REPORT_OPTIONS_ERROR :
strncpy (reason_string, n, "Invalid options in Report field in the message descriptor MQMD");
break;

and so on ...........
}
}

Regards,
Girish
 
Old 01-05-2007, 10:04 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi, girish_hilage -

Yup: that's exactly what I mean.

One minor suggestion - mq_perror would be a lot more useful if it returned a pointer to your *reason buffer:
Code:
char * mq_perror (int reason_code, char *reason_string, int n)
That way, you could use it directly inside of "printf()", etc. Just a thought...
 
Old 01-07-2007, 03:31 AM   #5
girish_hilage
Member
 
Registered: Oct 2003
Posts: 78

Original Poster
Rep: Reputation: 15
Yes. Thank you very much for your reply.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IBM Thinkpad T series, Comments Vince013 General 5 09-11-2006 06:52 AM
Patches of Linux for IBM POWER series server sony.abraham Linux - Server 2 08-13-2006 09:03 PM
Installing Linux on an old IBM 365-series Thinkpad. Milky Moo Cow Mandriva 10 08-27-2004 05:11 PM
IBM ultraconnect on G series joejavaman Linux - Wireless Networking 0 06-20-2004 10:37 PM
SuSE Linux for IBM i-series kinct Linux - Distributions 1 04-29-2004 12:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration