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 » WebSphere Message Broker (ACE) Support » Preserving NewLine Chars on conversion from EBCDIC to ASCI

Post new topic  Reply to topic
 Preserving NewLine Chars on conversion from EBCDIC to ASCI « View previous topic :: View next topic » 
Author Message
Pegazus
PostPosted: Tue Feb 17, 2009 8:15 am    Post subject: Preserving NewLine Chars on conversion from EBCDIC to ASCI Reply with quote

Novice

Joined: 10 Aug 2006
Posts: 16

We are receiving data from the Mainframes in EBCDIC format and on conversion from EBCDIC to ASCII the new line characters seem to disappear.

Here is the Flow CICS -> MQ -> WMB (Convert EBCDIC to ASCII + BLOB to MRM) -> MRM to XML -> HTTP

We change the Enconding on the MQ Input node to convert from EBCDIC to CCSID 500. Then the mapping of the data seems to be fine from BLOB to MRM. But one of the field contains many New Line characters, which seems to be lost on conversion.

Can anyone help me here.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 17, 2009 8:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I would theorise the EBCDIC has <CR> characters, while the ASCII platform uses <CRLF> for end of line.

Have you actually looked at the hex in the string, to confirm the characters are actually missing, or if it just looks like they are when you view in ASCII?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Pegazus
PostPosted: Tue Feb 17, 2009 8:26 am    Post subject: Reply with quote

Novice

Joined: 10 Aug 2006
Posts: 16

Thank you for your response. You are correct. Is there a way to convert CR to CRLF's

Is there a standard way of doing it ?
Back to top
View user's profile Send private message
Tibor
PostPosted: Tue Feb 17, 2009 8:34 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

Pegazus wrote:
Thank you for your response. You are correct. Is there a way to convert CR to CRLF's
Is there a standard way of doing it ?

There was a similar topic yesterday

http://www.mqseries.net/phpBB2/viewtopic.php?t=47746
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Feb 17, 2009 8:37 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Pegazus wrote:
Is there a standard way of doing it ?


Yes - don't send them!

Seriously, it's a problem. If you know that the input is pure character and contains no packed numbers then you can do a simple replace, but I notice you refer to BLOB in your original post. Obviously if you have packed decimal that could legitimately be x'0d' and you don't want that replaced.

Mind you, if you're moving packed numbers from z/OS to most ASCII platforms you've got other issues anyway!

One way (but often the hardest to implement) is for the z/OS to either tweak the message to contain <CRLF> or better still use a different and unlikely combination as an end-of-line marker. In this way you reduce the odds of hitting a combination you don't really want to replace.

The question you need to ask is do you actually need a <CRLF>, or do you just need a way of finding the end of a line in an application? The <CR> is a perfectly valid marker for that, even if it's not what most ASCII file viewers are expecting.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue Feb 17, 2009 7:52 pm    Post subject: Re: Preserving NewLine Chars on conversion from EBCDIC to AS Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

Pegazus wrote:
We are receiving data from the Mainframes in EBCDIC format and on conversion from EBCDIC to ASCII the new line characters seem to disappear.

There is a one-to-one mapping of control characters between EBCDIC character sets and ISO-8 ("ASCII") character sets:
Code:
                      ISO-8      EBCDIC
                      -----      ------
(LF/line feed):       X'0a' <--> X'25' (LF/line feed)
(CR/carriage return): X'0d' <--> X'0d' (CR/carriage return)
(NEL/next line):      X'85' <--> X'15' (NL/new line)


Exactly which combination of these characters constitutes an "end-of-line" delimiter might vary from application to application, but the characters don't just disappear.

Pegazus wrote:
Here is the Flow CICS -> MQ -> WMB (Convert EBCDIC to ASCII + BLOB to MRM) -> MRM to XML -> HTTP

The XML parsers may discard white space though, and normalize "end-of-line" delimiters. Don't spend a lot of time "fixing" end-of-lines, if the XML parser is going to undo that work anyway.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 18, 2009 12:59 am    Post subject: Re: Preserving NewLine Chars on conversion from EBCDIC to AS Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

rekarm01 wrote:
There is a one-to-one mapping of control characters between EBCDIC character sets and ISO-8 ("ASCII") character sets:


But control characters are not used in the same way.

rekarm01 wrote:
Exactly which combination of these characters constitutes an "end-of-line" delimiter might vary from application to application, but the characters don't just disappear.


I think the poster had already determined that further up the thread.

rekarm01 wrote:
Don't spend a lot of time "fixing" end-of-lines, if the XML parser is going to undo that work anyway.


This is a similar issue to the other thread I linked to. The point is that these characters are being treated as payload not whitespace and the intention seems to be that the XML document should include them.

So it becomes an issue of data transport and packaging.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Feb 21, 2009 5:49 pm    Post subject: Re: Preserving NewLine Chars on conversion from EBCDIC to AS Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

Parts of the original problem description are unclear:
Pegazus wrote:
We change the Enconding on the MQ Input node ...

The MQInput "Convert encoding" property governs the conversion of numeric data, not character data.
The MQInput "Convert coded character set ID" property governs the conversion of character data, not numeric data.

Pegazus wrote:
... to convert from EBCDIC to CCSID 500.

CCSID=500 is EBCDIC, not ASCII.

Vitor wrote:
rekarm01 wrote:
Don't spend a lot of time "fixing" end-of-lines, if the XML parser is going to undo that work anyway.

This is a similar issue to the other thread I linked to. The point is that these characters are being treated as payload not whitespace and the intention seems to be that the XML document should include them.

One important difference between this issue and the other thread is the XML parser, which treats these characters as whitespace, not payload; it has it's own translation rules for end-of-line handling, making it pointless to map CR->CRLF beforehand.
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 » WebSphere Message Broker (ACE) Support » Preserving NewLine Chars on conversion from EBCDIC to ASCI
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.