Author |
Message
|
atheek |
Posted: Fri Oct 24, 2008 2:52 am Post subject: Qmgr ccsid |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
dis qmgr shows ccsid as 437
USing Java api
MQQueueManager.getCharacterSet () returns 819
Any idea why these are differing.
MQ 6.0.2.3 Win2k3 |
|
Back to top |
|
 |
gs |
Posted: Fri Oct 24, 2008 3:32 am Post subject: |
|
|
 Master
Joined: 31 May 2007 Posts: 254 Location: Sweden
|
Has the CCSID been changed without a restart of the qmgr? |
|
Back to top |
|
 |
atheek |
Posted: Fri Oct 24, 2008 3:52 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
No..437 is windows default i believe..all new gmgrs have the ccsid value as 437 after creation |
|
Back to top |
|
 |
David.Partridge |
Posted: Fri Oct 24, 2008 4:22 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
To address the question specifically, the queue manager CCSID and the default CCSID used by the MQ Java interface are unrelated.
The queue manager CCSID is set to a default value dependent on platform and language settings. Typically on Windows this would mean that if you are using UK English the the CCSID would be set to 850, but if using US English it would be 437. For other platforms and language settings this will alter, but is aimed at code using (typically on *nix systems) the C language where the language settings determine how string data are processed. Similar comments apply of course to COBOL, PL/I and others on MVS.
The CCSID used by the MQ Java interface when you connect as an MQ client is always (AFAIK) set by default to 819 which is ISO8859-1, though you can of course override this in your application. <incorrect information removed>.
I think you will find that if you connect to the QM using Java code in bindings mode, then the value returned will be the actual setting of the queue manager. _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
atheek |
Posted: Fri Oct 24, 2008 4:39 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Thanks David. Now I understand. I was connecting in client mode. |
|
Back to top |
|
 |
gs |
Posted: Fri Oct 24, 2008 5:37 am Post subject: |
|
|
 Master
Joined: 31 May 2007 Posts: 254 Location: Sweden
|
Quote: |
To address the question specifically, the queue manager CCSID and the default CCSID used by the MQ Java interface are unrelated. |
If you by "MQ Java interface" mean the client settings, wouldn't the client CCSID be represented in MQEnvironment.CCSID ? And that value is defaulted to 819 and not applicable when using bindings mode (naturally).
MQQueueManager.getCharacterSet() should still return the actual CCSID of the QMGR? |
|
Back to top |
|
 |
atheek |
Posted: Fri Oct 24, 2008 6:11 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Tried playing around with MQEnvironment.CCSID.
getCharacterSet() always return whatever value specified in the MQEnvironment .CCSID field . So its the client environment setting that is returned.
The documentation for getCharacterSet is the confusing bit here:
Quote: |
getCharacterSet public int getCharacterSet() throws MQException;
Gets the CCSID (Coded Character Set Identifier) of the queue manager’s codeset. This defines the character set used by the queue manager for all character string fields in the application programming interface.
Returns the CCSID.
|
It looks like that the qmgr ccsid will be returned..but reading carefully it says the character set used by the queue manager for all character string fields in the application programming interface.
All character string fields for a message from a client application will be in the ccsid as that of the client environment. I read somewhere that MQ is intelligent enough to even set the MQMD CCSID field correctly , when a client app puts the message specifying to use the ccsid of the qmgr. MQ sets the ccsid of the client environment in the message descriptor field in this case..
So looks like everything is working as designed and documented correctly.
Actually, I was trying to write a simple program using java api( no pcf) to read qmgr attributes. Does any one know an alternate way to get the qmgr's ccsid? |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Oct 24, 2008 11:37 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
atheek wrote: |
... MQ is intelligent enough to even set the MQMD CCSID field correctly , when a client app puts the message specifying to use the ccsid of the qmgr. MQ sets the ccsid of the client environment in the message descriptor field in this case...
|
This is correct. For a more extreme example, a client running on Windows can use the same code to connect to a Unix QM as well as a Windows QM as well as a mainframe QM. In all cases the data the app is producing is in fact ASCII 437, and should be identified as such, regardless of the O/S that the queue is on that holds that message. But if that same app was moved directly onto the Unix system or the z/OS system and did the put again, the data would be a different CCSID, and the code would still not have to be changed and MQ would properly tag the data with the correct CCSID, either 819 (Solaris) or 500 (z/OS). _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|