Author |
Message
|
wangquanyong |
Posted: Wed Jan 23, 2002 6:53 pm Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Thu Jan 24, 2002 7:23 am Post subject: |
|
|
 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 |
|
 |
wangquanyong |
Posted: Thu Jan 24, 2002 6:21 pm Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Thu Jan 24, 2002 10:02 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
|
Back to top |
|
 |
StefanSievert |
Posted: Fri Jan 25, 2002 1:49 am Post subject: |
|
|
 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 |
|
 |
wangquanyong |
Posted: Fri Feb 15, 2002 4:59 am Post subject: |
|
|
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 |
|
 |
andy840920 |
Posted: Mon May 21, 2007 6:44 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 44
|
how to set CCSID in C program? |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 21, 2007 6:59 am Post subject: |
|
|
 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 |
|
 |
|