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 » Setting of CCSID

Post new topic  Reply to topic
 Setting of CCSID « View previous topic :: View next topic » 
Author Message
angka
PostPosted: Thu Nov 16, 2006 5:41 pm    Post subject: Setting of CCSID Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi all,

What is the best practice for setting the CCSID of a message communicating between 2 MQ server? For example, the sender in Windows platform using .NET will have a default CCSID of 1200 so is it necessary for the Sender to set the message CCSID to 437 before sending out the message? On the receiving end, is it right that the receiver in any platform will have to set their CCSID correspond to their platform before reading the Application Data?

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 16, 2006 5:45 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The best practice is to ignore the CCSID entirely, and code your applications to specify MQGMO_CONVERT on all their GETS.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Nov 17, 2006 6:45 am    Post subject: Reply with quote

Guest




By default, the queue manager (on the platform where the program MQPUTs the message) will fill in the CCSID of the message descriptor with the queue managers CCSID.

Optionally (not best practice), the programmer can fill in (hard code) the field with a CCSID; but this makes the program non-portable to another platform.
Back to top
zpat
PostPosted: Fri Nov 17, 2006 7:28 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Sorry that's not correct. No conversion happens by changing the CCSID.

The MQMD.CCSID must correctly DESCRIBE the message data - it does not convert it.

If the default CCSID is not the same as the codepage of the message data you MUST set it to be the correct value. You should only leave it alone if it matches the data.

Providing it matches the data then conversion can occur either on the channel if CONVERT(YES) or by MQGMO_CONVERT.

Also the MQMD.Format must be set to MQFMT_STRING ("MQSTR")
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Nov 17, 2006 7:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Actually, the MQMD.Format must be set to a known format for MQ to perform the conversion.

That is, MQ must be able to find a conversion routine for the format.

It's just that most of us send TEXT data, and so using MQFMT_STRING invokes the default TEXT conversion routine, which is what we want.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Nov 21, 2006 1:18 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi all,

zpat: I using .NET and below are my codes which converts the application data to the MQMD.CCSID that i set.

string message ="hello";
queueMessage.CharacterSet = 819;
queueMessage.WriteString(message);

so it is the WriteString function and not MQ tt converts it. Thanks all
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 21, 2006 2:30 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

But now you've coded your sender to do something specific for the platform that your reciever is on, and that's not a good idea.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JasonE
PostPosted: Tue Nov 21, 2006 3:16 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

.net and java convert between unicode and the codepage in the message ccsid during the read or writestring operations - in these languages you generally dont use get with convert. This is because those languages work internally in unicode and provide data conversion routines, plus you access the message through getters/setters so it can occur.

C, COBOL, PLI, C++ etc just get the message contents, and for those you would generally use get with convert so the data is converted to the ccsid ready for direct binary access to the data.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Nov 21, 2006 6:57 pm    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi all,

jefflowrey: I didnt code it that way.. just testing out. Thanks..

I will follow the best practice. thanks all. =)
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 » Setting of CCSID
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.