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 » IBM MQ Installation/Configuration Support » How to link a "c prog" to read/write messages from

Post new topic  Reply to topic
 How to link a "c prog" to read/write messages from « View previous topic :: View next topic » 
Author Message
ramu
PostPosted: Thu Sep 01, 2005 6:10 am    Post subject: How to link a "c prog" to read/write messages from Reply with quote

Newbie

Joined: 01 Sep 2005
Posts: 1

Hi,

I am trying to run a sample C programs to read/write messages from/to a queue. I can able to run the exe files available with MQ successfully to do this. But if compile and run the sample C(amqcget0/amqcput0) programs, i am getting 2058 error code.

Do i need to do any bindings as we do for JMS java programs?

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 01, 2005 6:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you are getting back a 2058, that means your program is compiled and linked correctly.

You are just not giving it the right information. A 2058 is well documented in the Messages manual, and extensively discussed here.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
nmaddisetti
PostPosted: Fri Sep 09, 2005 8:12 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi Jeff
my requiremnet is
i want to write a file into queue using C Program
so iam planing to modify amqput0.c program to write file into queue
initially iam runing sample program provided with MQ5.3
iam geting 2058 error
we know that 2058 reason code means Queue Manage Name Error
but we are giving correct queue manager name
still we are getting same problem
can you tell me what might be the problem

thanks
nmaddisetti
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Sep 09, 2005 8:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Quote:
we know that 2058 reason code means Queue Manage Name Error
but we are giving correct queue manager name
Its unlikely you are giving the correct name.
check the case of the qmgr name .. QM1 is different than Qm1.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
nmaddisetti
PostPosted: Fri Sep 09, 2005 9:36 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi
my QManager name is WBRK_QM
and iam giving the same name
thanks
nmaddisetti
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Sep 09, 2005 9:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Try issuing the dspmq command to make sure you've got the name right.

I'd also double-check that you are running with the correct version of the program. amqsput (no C) is the bindings version. amqsputC is the client version. You might be running the client version and getting to the wrong machine.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
nmaddisetti
PostPosted: Fri Sep 09, 2005 9:55 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi bower
iam not uisng exe files provided with MQ
i compiled amqsput0.c program
and iam trying to execute that progrm with 2 parameters
queue name and queuemanager name
at that time iam getting 2958 error
some one can tell me what else iam missing
thanks
nmaddisetti
Back to top
View user's profile Send private message
nmaddisetti
PostPosted: Fri Sep 09, 2005 10:01 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi
in my previous post it is not 2958
it is 2058
thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 09, 2005 10:05 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What you are missing is that you are passing the wrong qmgr name, or you do not have the right libraries on your RUNTIME path.

Maybe you linked the program aganist mqm.dll or etc and then are trying to run it on a machine with only mqic32.dll or etc.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
hopsala
PostPosted: Fri Sep 09, 2005 10:14 am    Post subject: Reply with quote

Guardian

Joined: 24 Sep 2004
Posts: 960

To emphesize what was already said - amqsput usage is as such: "amqsput <queuename> <qmgrname>" so make sure you got the order right; these parameters are case sensitive so you'd better check that as well.
Back to top
View user's profile Send private message
clindsey
PostPosted: Fri Sep 09, 2005 1:23 pm    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Code:

 compiled amqsput0.c program
and iam trying to execute that progrm with 2 parameters


What libraries did you link with, and what O/S?

For windows, if you linked amqsput0.c with mqic32.lib and run it, you will get 2058. You must first set MQSERVER environment varialble.
set MQSERVER=SYSTEM.DEF.SVRCONN/TCP/localhost(1414)

change the 1414 to whatever port you qmgr listener is on.

Then run amqsput0 <queuename>
You don't have to give the qmgr name. It is derived from the qmgr port.

If you linked with mqm.lib, then you must give qmgr name only if it is not the default qmgr and as already pointed out, it is case sensitive.

Hope this helps,
Charlie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » How to link a "c prog" to read/write messages from
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.