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 IBM MQ Support » MQSeries programing with C++

Post new topic  Reply to topic
 MQSeries programing with C++ « View previous topic :: View next topic » 
Author Message
wangquanyong
PostPosted: Wed Jan 23, 2002 6:53 pm    Post subject: Reply with quote

Novice

Joined: 22 Jan 2002
Posts: 17
Location: China

I am a begginer to study MQSeries programing with C++.
I want to connect a MQ client(Japanese Win2K) to MQ server(HP-Unix), and put/get messages into/from a queue in a queue manager.
First, I tried the sample imqwrld.cpp with parameter:mqueueName mqmanagerName channelName/TCP/mqServer-address(port), and get the reasonCode 2059 with error "AMQ9541: CCSID supplied for data conversion not supported.
EXPLANATION:
The program ended because, either the source CCSID '1051' or the target CCSID
'932' is not valid, or is not currently supported.
ACTION:
Correct the CCSID that is not valid, or ensure that the requested CCSID can be
supported. " in file amqerr01.log.
I know 932 is the CharacterSet of Japanese.
How do I to change the CCSID from 932 to 1051 before connect to mqManager by C++ code?
Although I konw it is simply to change it in Java code with class MQEnvironment.
Can I get any advice?
Back to top
View user's profile Send private message
kolban
PostPosted: Thu Jan 24, 2002 7:23 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Would it be possible for you to post your program and identify the exact line that the error is occuring at? Also, if you connect to your queue manager using the "runmqsc" command, can you post the results of "dis qmgr"?
Back to top
View user's profile Send private message
wangquanyong
PostPosted: Thu Jan 24, 2002 6:21 pm    Post subject: Reply with quote

Novice

Joined: 22 Jan 2002
Posts: 17
Location: China

Mr. kolban, thank you for your advice.
The exact line that the error occurs at is that of the call of MQManager.connect() funtion, it returns FALSE.

Now, by setting the system environment varible MQCCSID, I can overwrite the codepage 932 by 1051, and it looks working well.
But, my main problem is how to change the codepage with C/C++ code in program?
Back to top
View user's profile Send private message
kolban
PostPosted: Thu Jan 24, 2002 10:02 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

It would appear that the attribute is not explicitly programmable from an application see the following refernce:

http://www-4.ibm.com/software/ts/mqseries/library/manualsa/csqzaf05/csqzaf052e.htm#HDRAMQ25CU

You may be able to achieve what you want by setting the variable in your application just after having main() invoked. You should certainly set the variable before invoking your first client call.

The following C/C++ call may work:

putenv("MQCCSID=1051");
Back to top
View user's profile Send private message
StefanSievert
PostPosted: Fri Jan 25, 2002 1:49 am    Post subject: Reply with quote

Partisan

Joined: 28 Oct 2001
Posts: 333
Location: San Francisco

Neil et al,
I would be surprised if this will work. I had tried the same thing for a different variable. With NetBIOS connections, every process had to have its own NetBIOS name. To achieve this, I tried to call putenv to set the MQNAME environment variable; to no avail. If I recall correctly, it had something to do with the C runtime caching the environment on process initialization. C++ might show the same sypmtoms. Doesn't really solve the problem, but might save some time.
The question I would have is: Why do you need to set it in the program? It's usually a static (not frequently changed) variable, which you could define outside the application, right!?
_________________
Stefan Sievert
IBM Certified * MQSeries


[ This Message was edited by: StefanSievert on 2002-01-25 01:52 ]
Back to top
View user's profile Send private message
wangquanyong
PostPosted: Fri Feb 15, 2002 4:59 am    Post subject: Reply with quote

Novice

Joined: 22 Jan 2002
Posts: 17
Location: China

Thank you very much Mr.Kalban.
Use putenv("MQCCSID=1051") I have solved the problem.
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon May 21, 2007 6:44 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

how to set CCSID in C program?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon May 21, 2007 6:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

andy840920 wrote:
how to set CCSID in C program?


When I said "different thread", I actually was thinking of a new one!

As I said in your other post, don't set the CCSID within your program.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » General IBM MQ Support » MQSeries programing with C++
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.