Author |
Message
|
wbiuid |
Posted: Tue Jun 14, 2005 4:36 am Post subject: Handling pound sign (£) in WBI |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 34
|
Hi,
We have a message flow in WBI (5) running on AIX that receives data from another AIX queue manager but sends data to mainframe. The flow is very basic in that it moves data from an XML field to a BLOB. The problem is that the input data contains a £ sign (hex A3) which WBI treats as a non printable character and outputs it as (hex FA), thus losing the £ sign we need to send to mainframe.
We can get around this but doing a find/replace for the special character replacing with £ and converting the data to EBCDIC (using cast with CCSID 500) in the last part of the flow. However, is there a way to handle this generically using CCSID values etc rather than doing a find/replace in every flow that might need it?
For information, our default CCSID on WBI q manager is 819, the value of CCSID of the incoming MQMD is 437 (from the sending q manager). We do not have convert option specified on the MQ input node.
Thanks. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jun 14, 2005 5:08 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
CCSID 500 is International. You should use CCSID 285 on a UK mainframe queue manager.
Why not leave the message in the UNIX codepage in the broker and ensure the receiving mainframe application issues MQGET with CONVERT?
That is the correct way to architect messaging applications - the sender (or the broker) should not have to know what platform or codepage the receiver is running on. |
|
Back to top |
|
 |
wbiuid |
Posted: Tue Jun 14, 2005 6:21 am Post subject: |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 34
|
Thanks for the reply.
However, if you put to one side the fact we want to send to the mainframe, the initial problem we are getting is when we parse the message WBI seems to automattically change the Hex value from 'A3' to 'FA'.
For example, we did the following tests, where each test had 1 message on input queue with 1 XML field where one of the characters in the field was a £ character (hex A3) :
1. Simple flow with input node to output node (no parsing of XML) - output message still had hex value of 'A3'.
2. Simple flow with input node to compute node (i.e. parse the XML data and just pass the contents of the XML field to a BLOB) to output node - output message had the same contents as the input XML field but now had hex value of 'FA' instead of 'A3' where the £ sign was. Which won't get converted to EBCDIC £ ('44') by the mainframe app?
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 14, 2005 6:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Broker converts everything to Unicode when it creates the logical message tree. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wbiuid |
Posted: Tue Jun 14, 2005 6:52 am Post subject: |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 34
|
Can you explain exactly what that means (converting logical message tree to unicode?). Does it mean all special ASCII characters are converted to another code?
Is there anyway we can maintain this £ character (hex 'A3') on output without losing it?
Thanks |
|
Back to top |
|
 |
zpat |
Posted: Tue Jun 14, 2005 7:02 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Unicode is a code page, or rather several options like UCS-2, UTF-8.
You might want to experiment with setting CONVERT on the MQINPUT node as an alternative.
What is also essential is to ensure the origin message has the correct CCSID for the data it contains. It should have a UK compatible CCSID if it contains a £ (pound sterling) sign. The format must be MQSTR. |
|
Back to top |
|
 |
wbiuid |
Posted: Tue Jun 14, 2005 7:32 am Post subject: |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 34
|
Thanks. We tried the convert option on the MQInput node but this did not work.
The sending CCSID is 437 and the WBI CCSID is 819. Does anyone know if either of these UK compliant? |
|
Back to top |
|
 |
martinrydman |
Posted: Tue Jun 14, 2005 10:03 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
|
Back to top |
|
 |
RocknRambo |
Posted: Tue Jun 14, 2005 12:14 pm Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
We were able to solve the Umla charecter from German... by making
CodedCharSetId &Properties for MQMD =819 and
CodedCharSetId &Properties for Properties = 273
I guess this shud handle the UK charecters too...
-RR |
|
Back to top |
|
 |
wbiuid |
Posted: Thu Jun 16, 2005 5:08 am Post subject: |
|
|
Apprentice
Joined: 14 Jun 2005 Posts: 34
|
Thanks all - we managed to solve the initial problem because we were casting the message to a outgoing BLOB with CCSIS 1208. When we did the cast using 819 is maintained the £ (A3) character out of WBI.
BUT (there's always one!), our problem now is this -
Data sent from WBI (AIX CCSID 819) to Mainframe(z/OS CCSID 500) - 'ABCD£$' where CCSID on MQMD is 819.
When our Mainframe app converts this (issues a MQGMO_CONVERT) it converts the data to -
'ABCD[£' (the £ is converted to [ and $ is converted to pound). How can a conversion between ASCII 819 and EBCDIC 500 do this? Both CCSID's are multilingual according to the manuals? |
|
Back to top |
|
 |
zpat |
Posted: Thu Jun 16, 2005 5:43 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
As I said, the default CCSID for a UK mainframe should be 285, not 500.
This is a queue manager setting, QMCCSID=285. That's what we use - we had a similar problem and after changing it went away.
Be careful how you examine the mainframe message - many Windows tools will mis-represent the characters - check the underlying hex value. |
|
Back to top |
|
 |
LordGladstone |
Posted: Wed Jun 07, 2006 7:39 am Post subject: |
|
|
Novice
Joined: 07 Jun 2006 Posts: 19
|
I am having a similar problem. I am new to ESQL, so I am unsure how to get round this.
My code is parsing a SAP Idoc, coming from a queue manager with CCSID 819, when it finds the £ character and rejects it.
What do I have to do to manipulate the InputRoot so that the string is not converted to codepage 1208 ? My first attempt to do this was
SET OutputRoot.MQMD.CCSID = CAST(BITSTREAM(InputBody) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
SET OutputRoot.MQMD.ENCODING = CAST(BITSTREAM(InputBody) AS CHARACTER ENCODING InputRoot.MQMD.Encoding);
But this gave the error:
"Unconvertable character a3" |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 07, 2006 6:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You do not convert the contents of the MQMD!!
You only convert the contents of the MessageBody i.e. InputBody to OutputRoot.{parser}.{outputbody}
So what you are trying to do is, instead of setting the values for the CCSID and Encoding, set the InputBody as bitstream (and please use ASBITSTREAM and not BITSTREAM) to those fields ==> major field overflow and definitely wrong field type.
If you want to set those fields set them in the Properties, not the MQMD?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
LordGladstone |
Posted: Thu Jun 08, 2006 1:22 am Post subject: |
|
|
Novice
Joined: 07 Jun 2006 Posts: 19
|
My second attempt is:
SET OutputRoot.Properties.CCSID = CAST(ASBITSTREAM(InputBody) AS CHARACTER CCSID InputRoot.MQMD.CodedCharSetId);
SET OutputRoot.Properties.Encoding = CAST(ASBITSTREAM(InputBody) AS CHARACTER ENCODING InputRoot.MQMD.Encoding);
But this gives the error:
Jun 8 10:15:24 e014dae0 WMQIv210[83224]: (Q.E014DAE0.1.JON_EXEC_GRP_01)[6701]"N
N413E: Attempt to Translate messages from CodedCharSetId 1208 failed. Verify that CodedCharSetId 1208 is valid and that the Message contains characters valid for this CodedCharSetId. ": Q.E014DAE0.1.90097ed5-0201-0000-0080-89adda2f12ef: IbmUtil.cpp: 207: NewUcs: :
As I said, I am new to ESQL so I am struggling. It doesnt seem right to me to set the properties of the output root as I believe it is the parsing of the input data that is failing - is that right ?
But I cant change the Input root properties without getting a syntax error on the deploy:
BIP2523E: (75, 1) : Cannot assign to a symbolic constant or input message.
Values cannot be assigned to symbolic constants or input message fields.
Correct the syntax of the expression and redeploy the message flow. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 08, 2006 4:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't force broker not to convert data in the Logical Message Tree into codepage 1208.
It should not be rejecting the £, unless that character is invalid in your message model. 1208 is Unicode, and has a valid character for every character....
You do not want to assign CCSID and Encoding values using CAST at all.
Also, the proper name of those fields is not "CCSID" and "ENCODING", but "CodedCharSetId" and "Encoding" - the same name on the Output as on the Input.
If you are having issues because of the £ getting changed into the wrong value, then you need to better understand how the input mesage is built. It may be that the input message CCSID does not actually match the byte data. If the Input message CCSID says that the data is in codepage 819, but it is actually in codepage 500 then characters will be converted "wrong".
So let's start over with your problem. What is the value of InputRoot.MQMD.CodedCharSetId? What do you mean that the £ is getting "rejected" - is there an error message? What is it? Is this getting turned into the wrong thing? What is it getting turned into? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|