Author |
Message
|
Alaa Ahmed |
Posted: Mon Feb 16, 2004 6:16 am Post subject: EBCDIC TO ASCII conversion |
|
|
Newbie
Joined: 16 Feb 2004 Posts: 1 Location: Egypt
|
Gentlemen,
I am running a broker on AIX machine with WMQIB 2.1 and I have some message flows that deal with backend OS/390.
Now for conversion between ASCII (on AIX) and EBCDIC (on OS/390) I am using the following scenario:
From AIX to OS/390:
1. On the MRM message, the field is binary (e.g. Transaction_Description)
2. I implemented sub flow that converts from ASCII to EBCDIC (it takes Binary in ASCII and convert it to binary in EBCDIC) and this sub flow take care of Arabic letters combinations.
From OS/390 to AIX:
In the MQInput Node I checked the conversion flag and I set the convertEncoding to 546 and convertCodedCharSetId to 819.
Both cases are working fine, but I need to improve the performance by changing the Transaction_Description filed to string in the MRM message (this will eliminate the overhead of the sub flow that converts from ASCII to EBCDIC).
Also it will eliminate another overhead in the reply flow that convert the binary in ASCII to string.
I converted the filed type (Transaction_Description) to string but unfortunately I received garbage data.
My question: is there any way to convert string fields from ASCII to EBCDIC and visa versa with out any additional coding.
Note:
Both the request and reply messages with the backend have the format "MQSTR " and the files may contain Arabic data.
Thank In advance
Alaa
-----------------------
IBM Certified Solutions Expert - WebSphere MQ Integrator
IBM Certified Specialist - MQSeries and WebSphere MQ Integrator |
|
Back to top |
|
 |
wooda |
Posted: Mon Feb 16, 2004 6:57 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
The MRM will do field by field conversion for encoding and ccsid.
It will convert string fields (and all numeric fields in TDS/XML format)according to the ccsid.
It will convert numeric encoded fields (CWF) according to the encoding.
It will do no conversion on binary fields.
If using CWF then the length units field will effect how lengths of string fields are calculated if the ccsid allows double byte characters.
Iyou are inputing from MQ then all you need to do is set the CCSID and ENCODING of the last header before the payload to match the data.
The incoming message will be converted to UTF-8 when it is parsed by the MRM. It is stored internally as UTF-8 and converted again on output.
If you wish to write out in a different ccsid/encoding from the input message. Then change the properties fields in the message tree using a compute node. The output node will use these values to do conversion when the message is serialized back into an MQ message.
I do not think in your case you need to change the input node properties. |
|
Back to top |
|
 |
EgilsJ.Rubenis |
Posted: Tue Feb 17, 2004 1:44 am Post subject: |
|
|
Acolyte
Joined: 18 Nov 2002 Posts: 63 Location: Germany, Alfeld
|
Hi,
make sure channel conversion (in the channel definition) ist set to
"yes".
This makes sure that a conversion happens automatically without any coding.
cheers, egils |
|
Back to top |
|
 |
JLRowe |
Posted: Tue Feb 17, 2004 11:31 pm Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
No, enabling channel conversion is not a good idea.
This was intended for queue managers that do not support the full range of CCSID's and need to have data converted by the sending queue manager. The queue manager does not know the format of your data (only MQSI does), and therefore can only perform conversion in certain circumstances (MQFMT is PCF or MQSTR).
The standard pattern for data conversion in WMQ (and WBIMB), is 'receiver makes good', this is achieved by specifying the convert option on an MQGET, or by doing the conversion yourself (as MQSI does). |
|
Back to top |
|
 |
zpat |
Posted: Wed Feb 18, 2004 1:02 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you send all your data as MQSTR (eg XML) and use MQGET with CONVERT (or the equivalent tick box on a MQINPUT node) then this issue does not happen.
It's a good idea to code all applications with MQGET with CONVERT so that you can later change the queue manager from distributed to mainframe (should you need to) without changing the application. |
|
Back to top |
|
 |
|