Author |
Message
|
gayathri |
Posted: Wed Jul 06, 2005 10:36 pm Post subject: Conversion of EBCDIC to ASCII |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
Mainframe application writes message in the form of XML in MQ. Java application reads messages. There is some problem in EBCDIC to ASCII conversion. For eg. "!" character is read as a different character. How to set the CCSID property to fix this.
It would be great if you specify the MQI call for Java to fix this.
Which is the better way to solve this issue (changing in the sender end or the receiver end)
Thanks,
Gayathri |
|
Back to top |
|
 |
Remco |
Posted: Thu Jul 07, 2005 6:21 am Post subject: |
|
|
Acolyte
Joined: 19 Mar 2002 Posts: 68 Location: Capelle aan den IJssel (Rotterdam)
|
What code pages are you convertinf from-to ???
Remco |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jul 07, 2005 8:54 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
The ! is one of the charecters that does not get converted properly if you mainframe CCSID is 500. If you switch it to 037, it fixes it. Some other chars are also screwed up at CCSID 500, like the [ and ] _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 07, 2005 2:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
PeterPotkay wrote: |
The ! is one of the charecters that does not get converted properly if you mainframe CCSID is 500. If you switch it to 037, it fixes it. Some other chars are also screwed up at CCSID 500, like the [ and ] |
Hi Peter,
Sorry not quite true. Usually the '!' conversion problem comes from following configuration:
QMGR running with CCSID 500
MF running with CCSID 37.
There is no conversion being done when the MF retrieves or gets the message without doing a "get with convert". So yes you might see a "|" instead of "!".
The conversion done by the qmgr per se however (817 to 500) has always been fine. If you need a good conversion for those odd chars make sure you run your MF and QMGR with the same CCSID and that it is one supported for conversion.
Enjoy  |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jul 07, 2005 4:24 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Both our mainframe and MQ run as 500. And the ! gets futzed up when talking to Windows QMs. Even if the MF app does a GET with Convert. At least that's our expirience here. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 07, 2005 6:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Bizarre, bizarre.
I thought the same about our Mainframe....
Well we looked into the APP transformation going down to the bytes.
We found out that the get was done without conversion (Channel Exit does it) and that the bytes were all O.K. for CCSID 500. (We checked from the original CCSID 817 to CCSID 500 char conversion was fine. The problem was an MF internal one)
However the display was consistent with those same bytes but CCSID 37.
Go figure... This is why all of a sudden some "!" were showing up as "|".
Is there a way that the code could run in CCSID 037 when you expected it to run in CCSID 500 ?
Hope it doesn't confuse the issue.  |
|
Back to top |
|
 |
gayathri |
Posted: Thu Jul 07, 2005 8:06 pm Post subject: Conversion from EBCDIC to ASCII |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I am not aware what a "codepage" means. When I went thru some posts in this forum I understood that we have to change the CCSID and use MQC.MQ_GMO_CONVERT when we face this issue. But the problem is
1)I can expect contents inside the CDATA section of XML in almost 10 to 15 languages
2)I changed the FMT_STRING in the mainframe side and added MQC.MQ_GMO_CONVERT in the reading end. i.e in the Java program. But that also did not solve the problem. From one of the reply for this post I understood that GMO_CONVERT does not work properly always.
So please suggest the changes to be done to fix the problem
My queries are
1)Should CCSID be changed in the Queue Manager which sits on Mainframe/The sender application(which is a mainframe application/The reader application which is a Java application)?
2) Please specify the parameters to be changed.
3)My MQServer sit in a mainframe and the CCSID of the queue manager is 819 (iso-8859-1 / latin1 / ibm819 )
Thanks in adavnce for the help
Gayathri. |
|
Back to top |
|
 |
zpat |
Posted: Thu Jul 07, 2005 10:29 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MQ does not deal with CDATA any differently - it converts the entire message as one string. MQ has no specific awareness of XML.
If you want to avoid conversion of part of the message, you could encode that part as BASE64 and then decode it in Java, we do that to send image data (binary) inside XML.
There is no substitute for understanding this aspect of MQ, by reading the manuals, including Redbooks, Support Pacs etc.
http://www-1.ibm.com/support/docview.wss?rs=171&context=SSFKSJ&q1=data+conversion&uid=swg27005729 |
|
Back to top |
|
 |
gayathri |
Posted: Fri Jul 08, 2005 2:47 am Post subject: EBCDIC to ASCII conversion |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
I went thru the documentation. They have specified the code conversion between Qmgrs.
But my mainframe application writes data into the QueueManager in the mainframe. Java application reads the message from the same QueueManager in the mainframe.
Is GMO_CONVERT sufficient to fix this. My QueueManager CCSID is 819.
mainframe application->MQserver(mainframe,Qmanager CCSID=819)<-Java application(Windows)
Still the issue is unfixed. Kindly let me know if I have faultered somewhere.
Thanks,
Gayathri |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 08, 2005 3:24 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Why don't you just try it?
We have Java apps directly connected to mainframes as MQ client - no problem at all, converting EBCDIC (UK) to UNICODE (CCSID 285 to 1208).
You MUST use MQGMO_CONVERT - there is NO alternative for a single queue manager situation. The MQMD.Format must be MQSTR in the message.
One of the reasons I always recommend coding it is that it makes applications more flexible as they can use MQ client connections to different platforms for their QM and still work.
If using JMS, then use TextMessages, not BytesMessages. |
|
Back to top |
|
 |
gayathri |
Posted: Fri Jul 08, 2005 4:08 am Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
Should I change the CCSID of the Qmanager as 37 as specified in one of the posts? My queue manager's CCSID is 819.
I am going to try this
1)Change the MQ FMT as String in the sender's side in the mainframe end
2)Use GMO_CONVERT in the receiving end (messageOptions.options = messageOptions.options | MQC.MQGMO_WAIT | MQC.MQGMO_CONVERT)
Let me know if something is wrong. Thanks for u r patience.
Gayathri |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 08, 2005 4:16 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
|
Back to top |
|
 |
gayathri |
Posted: Fri Jul 08, 2005 4:28 am Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Thanks a lot Pat. Will try this and let you know.
Thanks a lot for your patient reply and for your clear clarifications.
This discussion forum is a boon for starters like me.
Thanks,
Gayathri |
|
Back to top |
|
 |
gayathri |
Posted: Fri Jul 08, 2005 4:51 am Post subject: |
|
|
Apprentice
Joined: 07 Jun 2005 Posts: 36
|
Hi,
Apart from specifying the Format as String should I specify the charset and the encoding style in the sender application i.e in mainframes?
Gayathri |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 08, 2005 6:06 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Providing the QM CCSID is correct and matches the data being placed in the message then you can leave the CCSID field value to default.
What people don't realise is that the CCSID on the MQPUT is meant to match the data so it is correctly described, no conversion takes place on the PUT.
But unless the CCSID correctly describes the data in the message - the conversion cannot possibly work correctly on the GET with CONVERT.
Format defaults to NONE (which is a real pain) so always code that as MQFMT_STRING (or "MQSTR").
Check persistence is set as required. |
|
Back to top |
|
 |
|