|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Data conversion problem between Windows MQ Client and Unix M |
« View previous topic :: View next topic » |
Author |
Message
|
LouML |
Posted: Fri Jan 22, 2010 5:39 am Post subject: Data conversion problem between Windows MQ Client and Unix M |
|
|
 Partisan
Joined: 10 Nov 2005 Posts: 305 Location: Jersey City, NJ / Bethpage, NY
|
I am the MQ Administrator for our company. I have an application programmer who is having a problem putting messages from his Windows server to my Unix server. I believe it's a data conversion problem.
The Windows server has MQ Client 6.0.2.5 and the Unix server is running MQ Server 6.0.2.5.
The programmer says he is using code that currently writes to a QRemote on a Unix server. That QRemote points to a QLocal on a Mainframe. The Sender channel from the Unix box to the Mainframe has the CONVERT(YES) option (I know this is not the preferred method for data conversion, however this is how it is setup and is being used by many others)
Now, he wants to use this same code to put a message to a QLocal on a Unix server. But when he does, the message looks like it adds a '.' after each character. His message does have line feeds so I don't know if that is causing the problem. He is using MQFMT_STRING, Encoding 273 and CodedCharSetId 819. Here is an example of his message:
Code: |
This is a test message from Windows MQ Client to Unix MQ Server |
When I browse it using amqsbcg, it looks like:
Code: |
MQGET of message number 3
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 819
Format : 'MQSTR '
Priority : 0 Persistence : 0
MsgId : X'414D5120514D2E61657761707071612E4B18BA7929800002'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'QM.TESTQM.01 '
** Identity Context
UserIdentifier : 'programmer '
AccountingToken :
X'16010515000000BD5358020445C63F8E4EBB418693000000000000000000000B'
ApplIdentityData : ' '
** Origin Context
PutApplType : '11'
PutApplName : 'in\MQTest\MQTest.exe'
PutDate : '20100122' PutTime : '13330155'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
length - 126 bytes
00000000: 5400 6800 6900 7300 2000 6900 7300 2000 'T.h.i.s. .i.s. .'
00000010: 6100 2000 7400 6500 7300 7400 2000 6D00 'a. .t.e.s.t. .m.'
00000020: 6500 7300 7300 6100 6700 6500 2000 6600 'e.s.s.a.g.e. .f.'
00000030: 7200 6F00 6D00 2000 5700 6900 6E00 6400 'r.o.m. .W.i.n.d.'
00000040: 6F00 7700 7300 2000 4D00 5100 2000 4300 'o.w.s. .M.Q. .C.'
00000050: 6C00 6900 6500 6E00 7400 2000 7400 6F00 'l.i.e.n.t. .t.o.'
00000060: 2000 5500 6E00 6900 7800 2000 4D00 5100 ' .U.n.i.x. .M.Q.'
00000070: 2000 5300 6500 7200 7600 6500 7200 ' .S.e.r.v.e.r. '
No more messages
MQCLOSE
MQDISCbash-2.05$ |
Can someone help shine a light on this? _________________ Yeah, well, you know, that's just, like, your opinion, man. - The Dude |
|
Back to top |
|
 |
zonko |
Posted: Fri Jan 22, 2010 6:22 am Post subject: |
|
|
Voyager
Joined: 04 Nov 2009 Posts: 78
|
The data in the msg if in Unicode, UCS-2, CCSID 1200, which uses 2 bytes for each character. The client app is supplying Unicode data to the MQPUT, and asserting that it is in 819. The solution is to fix either the client app or the data so that the code page of the data matches the code page asserted by the app. |
|
Back to top |
|
 |
zpat |
Posted: Fri Jan 22, 2010 6:34 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I am surprised that channel data conversion can work, if the data is ccsid 1200 but described as ccsid 819. The resulting message would be very strange on the mainframe!
The easiest thing to fix is this to update the message's MQMD.CCSID to 1200 before putting the message.
Is the program using JMS or the MQI? |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 22, 2010 3:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And remember .NET by default does not send ASCII but Unicode. You have to make sure the text you write to the message is in the CP you set on the message. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Sat Jan 23, 2010 3:42 am Post subject: Re: Data conversion problem between Windows MQ Client and Un |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
LouML wrote: |
the message looks like it adds a '.' after each character. |
amqsbcg uses '.' to display non-printable characters, such as the null character (X'00'). The hex on the left identifies the actual characters.
zonko wrote: |
The data in the msg if in Unicode, UCS-2, CCSID 1200 |
Actually, the data in the message is UCS-2LE (little-endian), CCSID 1202.
fjb_saper wrote: |
And remember .NET by default does not send ASCII but Unicode. |
For .NET, what the application sends depends on which Write*() method it uses to generate the message.
The same is true for Java or JMS. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|