ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Conversion of EBCDIC to ASCII

Post new topic  Reply to topic
 Conversion of EBCDIC to ASCII « View previous topic :: View next topic » 
Author Message
gayathri
PostPosted: Wed Jul 06, 2005 10:36 pm    Post subject: Conversion of EBCDIC to ASCII Reply with quote

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
View user's profile Send private message
Remco
PostPosted: Thu Jul 07, 2005 6:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
PeterPotkay
PostPosted: Thu Jul 07, 2005 8:54 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 07, 2005 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Thu Jul 07, 2005 4:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 07, 2005 6:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
gayathri
PostPosted: Thu Jul 07, 2005 8:06 pm    Post subject: Conversion from EBCDIC to ASCII Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Thu Jul 07, 2005 10:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
gayathri
PostPosted: Fri Jul 08, 2005 2:47 am    Post subject: EBCDIC to ASCII conversion Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Jul 08, 2005 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
gayathri
PostPosted: Fri Jul 08, 2005 4:08 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Jul 08, 2005 4:16 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Set the appropriate mainframe CCSID for your locale. I don't know where you are (or your mainframe is)!

819 does not seem right for a mainframe..as it's for ASCII!.

But it may not be needed once the above programming changes are made.

037 is for the USA, 285 is for the UK. Others are here:

http://publib.boulder.ibm.com/infocenter/pcomhelp/index.jsp?topic=/com.ibm.pcomm.doc/hcp_reference11.htm

If you're not sure, then probably 500 would be OK.
Back to top
View user's profile Send private message
gayathri
PostPosted: Fri Jul 08, 2005 4:28 am    Post subject: Reply with quote

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
View user's profile Send private message
gayathri
PostPosted: Fri Jul 08, 2005 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Jul 08, 2005 6:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Conversion of EBCDIC to ASCII
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.