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 IndexGeneral IBM MQ SupportDisplay Reason Description in Code

Post new topicReply to topic
Display Reason Description in Code View previous topic :: View next topic
Author Message
sumangeorge
PostPosted: Thu Mar 23, 2017 12:56 pm Post subject: Display Reason Description in Code Reply with quote

Newbie

Joined: 26 Feb 2017
Posts: 2

I am using IBM MQ Client to get and post messages.
In case of error i get reason code, but i need a reason description so that i can put it in a log file for others to understand.

Code:
Code:

MQCONNXAny strQueueManagerName, CNOCD, gHconListen_Out, CompCode, Reason

I am writing this code in VB6.
Please let me know if there's any way by which i can get reason description instead of code.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Mar 23, 2017 1:08 pm Post subject: Reply with quote

Yatiri

Joined: 09 May 2013
Posts: 678
Location: Bay of Plenty, New Zealand

There is a header file cmqstrc.h in the C include directory which facilitates this. You can see examples of it being used if you search the amqsevta.c sample for the function lookup.

I have no idea if you can use C header files from VB6. Is the VB interface even still in support?

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
gbaddeley
PostPosted: Thu Mar 23, 2017 3:12 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1645
Location: Melbourne, Australia

There is an old IBM SupportPac MA0K that had a VB module with a function to return the MQRC_ name for MQ ReasonCodes, but this was deprecated by newer MQ classes in .Net.

In VB6 and VB.Net, you can put a Try block around the MQ code, and do
Catch mqe As MQExeption.

mqe.ToString() returns something like "CompCode: 2, Reason: 2538"
mqe.Message returns "MQRC_HOST_NOT_AVAILABLE"
The individual codes are also accessible via mqe.CompletionCode & mqe.ReasonCode
_________________
Glenn
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 24, 2017 4:42 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24301
Location: Ohio, USA

hughson wrote:
Is the VB interface even still in support?


No.

But then, VB6 isn't in support either.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Mar 27, 2017 4:29 pm Post subject: Reply with quote

Padawan

Joined: 25 Mar 2003
Posts: 1645
Location: Melbourne, Australia

Vitor wrote:
hughson wrote:
Is the VB interface even still in support?

No.

MQ is currently supported in MS VisualStudio VB / C# via .NET classes. However, VB 6.0 is deprecated.
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q022830_.htm
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q023800_.htm
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexGeneral IBM MQ SupportDisplay Reason Description in Code
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.