Problem with converting EBCDIC to ASCII

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would suggest keeping the problem simple. How are you converting the EBCDIC to ASCII in your jobs? What version of EBCDIC do you have (there are several)?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

PhilHibbs wrote:Those characters don't exist in ASCII...
Hmmm... sort of; the first 7-bit implementation of ASCII did not have any of the extended characters, but 8-bit ASCII with the diacritics and other characters has been around as an ISO standard (ISO646) since 1972 and today "ASCII" is pretty much synonymous with the extended 8 bit representation.

Nevertheless your mail is spot-on in that the original poster needs to know which EBCDIC representation is being used and which character set it is being converted to.

Retraction - I just checked up on Wiki and see that official "ASCII" indeed remains as a 7-bit encoding and thus the diacritics and special characters are not part of ASCII. Thanks for the pointer!
jenny_wang
Participant
Posts: 26
Joined: Mon Nov 19, 2007 2:55 am
Location: Hangzhou

Post by jenny_wang »

actually I have 4 columns have those diacritics characters, and I am not sure how many different diacritics characters will be used in the column.
does that mean if I wanna convert those characters correctly, first I must enable NLS,then code as PhilHibbs post to replace all diacritics characters with Unicode characters?
Thanks for help!
jenny_wang
Participant
Posts: 26
Joined: Mon Nov 19, 2007 2:55 am
Location: Hangzhou

Post by jenny_wang »

actually I have 4 columns have those diacritics characters, and I am not sure how many different diacritics characters will be used in the column.
does that mean if I wanna convert those characters correctly, first I must enable NLS,then code as PhilHibbs post to replace all diacritics characters with Unicode characters?
Thanks for help!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you don't have NLS enabled this EBCDIC to ASCII conversion should work. Can you narrow it down to one character in EBCDIC and show the numeric value in EBCDIC and then the value after it is converted to ASCII?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I played around in Server and had the same issues with the characters in the upper range of ASCII.
Have you tried to see what happens when the FTP program takes care of the conversion from EBCDIC to ASCII - it might handle the characters appropriately.
Finally, you might have to revert to what Phil has already posted above.
gmt_etldev
Premium Member
Premium Member
Posts: 7
Joined: Mon Dec 17, 2007 1:37 am
Location: Boston, MA

Post by gmt_etldev »

one question:
if i don't enable NLS, can I do what as PhilHibbs post?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, but you can use the CHAR() function and drop the multibyte character.
jenny_wang
Participant
Posts: 26
Joined: Mon Nov 19, 2007 2:55 am
Location: Hangzhou

Post by jenny_wang »

I tried char(),but the DS can't recognize the 8-bit ascii, so I must enable the NLS and set the mapping character set as "ISO8859-1+MARKS", right?

Thanks!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, you don't need to enable NLS. Could you explain your problem with the CHAR() function - I don't see it having a problem with the full ASCII set.
jenny_wang
Participant
Posts: 26
Joined: Mon Nov 19, 2007 2:55 am
Location: Hangzhou

Post by jenny_wang »

please help!
Post Reply