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 » IBM MQ API Support » Converting EBCDIC to ASCII

Post new topic  Reply to topic
 Converting EBCDIC to ASCII « View previous topic :: View next topic » 
Author Message
Washington Morais
PostPosted: Mon Apr 30, 2012 6:00 am    Post subject: Converting EBCDIC to ASCII Reply with quote

Newbie

Joined: 09 Feb 2012
Posts: 7

hi all...

I need to get an EBCDIC message and convert it to ASCII. Is this enough?

Code:

...
if (getEbcdic)
{
  mQMessage.CharacterSet = [ what is the correct code? ];
  mQGetMessageOptions.Options |= MQC.MQGMO_CONVERT;
}
...


Message info:
Format: MQSTR
CCSID: 500
Encoding: 785


tks...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Apr 30, 2012 6:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

We don't know if it's sufficient or not.

We don't know the depth and complexity of your requirements.

If you actually tested that code, you would have a better idea of the results you would get.

Then you could investigate whether or not those results were sufficient.

You haven't said whether you are using Java or .NET. Assuming you're using Java, you would set your CharacterSet on the message object to the destination of the conversion, i.e. the character set you wanted the data to BECOME.

But only if you are doing this *before* you do the get.

You also probably do not need to actually set the character set. It will likely default to a useful value based on the environment your code is running under.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue May 01, 2012 1:32 pm    Post subject: Re: Converting EBCDIC to ASCII Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mqjeff wrote:
You haven't said whether you are using Java or .NET.

The code looks like .NET; the method/property names start with an upper-case character, and the .NET MQC interface isn't deprecated. However, the application logic for converting messages is much the same either way.

mqjeff wrote:
You also probably do not need to actually set the character set. It will likely default to a useful value ...

While this is true for most platforms, .NET seems to default to ccsid=1200 (UTF-16), rather than the qmgr ccsid, which may not be useful in this case.

Washington Morais wrote:
Message info:
Format: MQSTR
CCSID: 500
Encoding: 785

This presumably describes the input message.

Washington Morais wrote:
Code:
mQMessage.CharacterSet = [ what is the correct code? ];
mQGetMessageOptions.Options |= MQC.MQGMO_CONVERT;

The correct code depends on how the receiving application expects to interpret any non-ASCII characters. There are many ASCII-based coded character sets, such as:
  • 367 - US ANSI X3.4 ASCII (7-bit)
  • 819 - ISO/IEC 8859-1 (8-bit)
  • 1208 - UTF-8 (8-bit, multi-byte)
If .NET converts during read, rather than WMQ converting during get, it's not necessary to set the MQGMO_CONVERT option.

Washington Morais wrote:
Is this enough?

The best way to find that out is to test it.
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 » IBM MQ API Support » Converting 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.