Author |
Message
|
WMBEAI |
Posted: Sun Jan 17, 2010 11:02 pm Post subject: Message Broker to handle Spanish Character in XML Data |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
Hi,
When the broker encounters Spanish character in the XML data ,Unconvertable character exception 2135.
The below line throws the error
SET Environment.InputBlob = CAST(InputBlb AS CHARACTER CCSID 1208 ENCODING MQENC_NATIVE);
cedeño is the fieldvalue which causes the problem
How to handle this?
Message Broker version is 6.0.0.7 |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jan 18, 2010 12:15 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you looked for other posts here on this type of topic. There are many.
http://www.mqseries.net/phpBB2/viewtopic.php?t=51611
How are you getting the data into Broker? Is it Via WMQ? If so what is the CCSID on the incoming message?
If the message is sent with the wrong CCSID then you are in a bit of a pickle. Ideally, you should go back to the sender and get them to setup the MQMD properly.
If you are using WMQ then you should use InputRoot.MQMD.CodedCharacterSetID rather than hard coding 1208 in the conversion. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
WMBEAI |
Posted: Mon Jan 18, 2010 12:45 am Post subject: |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
I am getting the data via WMQ.
How do i find the CCSID of the sender? |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jan 18, 2010 12:48 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Look in the MQMD of the incoming message
I'd probably set the Input Node to use the BLOB domain and put a trace node right after it.
Or, use a utility such as Rfhutil _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
WMBEAI |
Posted: Mon Jan 18, 2010 12:53 am Post subject: |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
In the incoming message no MQMD is set by the sender.
Last edited by WMBEAI on Wed Jan 20, 2010 7:13 pm; edited 1 time in total |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jan 18, 2010 1:50 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If as you say, the message is being processed by an MQInputNode at the start of the flow then THERE MUST BE AN MQMD. Otherwise, it is not a valid WMQ Message.
Please take another look. put a trace node after the input node and look at the ${Root} folders. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 18, 2010 7:47 am Post subject: Re: Message Broker to handle Spanish Character in XML Data |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
WMBEAI wrote: |
Hi,
When the broker encounters Spanish character in the XML data ,Unconvertable character exception 2135.
The below line throws the error
SET Environment.InputBlob = CAST(InputBlb AS CHARACTER CCSID 1208 ENCODING MQENC_NATIVE);
cedeño is the fieldvalue which causes the problem
How to handle this?
Message Broker version is 6.0.0.7 |
- Make sure you do not have convert set on the MQInput node
- you are assigning a Character to a BLOB without casting... nono
- This is what your code should look like:
Code: |
DECLARE mystring character '':
SET mystring = CAST(InputBlb AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId ENCODING MQENC_NATIVE);
SET Environment.InputBlob = CAST(mystring AS BLOB CCSID 1208 ENCODING MQENC_NATIVE); |
Enough said... CCSID  _________________ MQ & Broker admin |
|
Back to top |
|
 |
WMBEAI |
Posted: Tue Jan 19, 2010 4:30 am Post subject: |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
The steps u had mentioned was followed.
I have a spanish character in the XML i send in cedeño.
I have a flow like
MQInput->compute->RCD->MQOutput
I receive the input message as BLOB in MQInput
RCD is set to XML.
i get parsing errors after RCD conversion. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 19, 2010 4:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
WMBEAI wrote: |
The steps u had mentioned was followed.
I have a spanish character in the XML i send in cedeño.
I have a flow like
MQInput->compute->RCD->MQOutput
I receive the input message as BLOB in MQInput
RCD is set to XML.
i get parsing errors after RCD conversion. |
You still don't seem to have answered the question about what CCSID the input message has. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBEAI |
Posted: Tue Jan 19, 2010 5:28 pm Post subject: |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
|
Back to top |
|
 |
flahunter |
Posted: Tue Jan 19, 2010 6:35 pm Post subject: |
|
|
 Acolyte
Joined: 30 Oct 2008 Posts: 62
|
I just have a queston of ENCODING.
Why not use ENCODING InputRoot.Properties.Encoding, what's the difference between MQENV_NATIVE and InputRoot.Properties.Encoding. Just correct me if there is anything wrong:) Thank you |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Jan 20, 2010 1:50 am Post subject: Re: Message Broker to handle Spanish Character in XML Data |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
WMBEAI wrote: |
Unconvertable character exception 2135... |
The rest of the error message would have been useful:
Code: |
BIP2135E: Source character '??' in field '...' cannot be converted to unicode from codepage '????'. |
... except without the question marks.
WMBEAI wrote: |
The code page is 437 |
Then the CAST should look something like:
Code: |
CAST(InputRoot.BLOB.BLOB AS CHARACTER CCSID 437) |
or better yet:
Code: |
CAST(InputRoot.BLOB.BLOB AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId) |
Last edited by rekarm01 on Wed Jan 20, 2010 2:21 am; edited 1 time in total |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Jan 20, 2010 1:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
flahunter wrote: |
I just have a queston of ENCODING.
Why not use ENCODING InputRoot.Properties.Encoding, what's the difference between MQENV_NATIVE and InputRoot.Properties.Encoding. |
CAST(BLOB AS CHAR) does not use the ENCODING parameter. But if it did, InputRoot.Properties.Encoding would be the correct one to use.
InputRoot.Properties.Encoding describes the input message. MQENC_NATIVE describes the broker's QMgr default setting. |
|
Back to top |
|
 |
WMBEAI |
Posted: Wed Jan 20, 2010 7:11 pm Post subject: |
|
|
Acolyte
Joined: 02 Mar 2009 Posts: 66
|
Thanks for ur answers.The issue was solved by setting to the InputRoot.Properties.Encoding and CCSID. |
|
Back to top |
|
 |
|