aspose file tools*
The moose likes Java in General and the fly likes ASCII TO EBCDIC: how ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "ASCII TO EBCDIC: how ?" Watch "ASCII TO EBCDIC: how ?" New topic
Author

ASCII TO EBCDIC: how ?

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
I want to write the highest value of the EBCDIC data
into an ASCII file in Java.

In other words,
I only to need to produce one value, and this value corresponds to the highest value in EBCDIC.

Thanks for your help.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 690
    
    1
Not sure what you are asking.
What is the 'highest value of the EBCDIC data'?
Do you have a file with EBCDIC data you want to convert to ASCII?

What is a value? A single byte? Like xFF?

Could you explain your problem a bit more and perhaps give an example?
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
thanks for replying.
Well, I do not know much about EBCDIC.
I will give more details:
I am working on Windows XP, using Eclipse. I am writing a batch that will generate an ASCII file which will be read by another program in a mainframe environment.
They have asked me to include in that line the xFF EBCDIC value.

How do I do that ?
Thanks
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Well a value such as xFF is just a value. The difference between ASCII, ANSI, EBCDIC, etc is how the values are interpreted. For example, the value 75 (decimal) is a 'K' in ASCII, but a full stop (period) in EBCDIC.

This link has a table of ASCII and EBCDIC codes side by side, though I'm sure you can easily find nicer ones with Google.
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

thanks very much again for the info, much appreciated
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Does anyone know of a concrete example on how to convert a single ASCII character into a EBCDIC one ?

Thanks !
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

can anyone help me here, please ?
It's urgent
Jiang Xiaofeng
Greenhorn

Joined: Jul 19, 2005
Posts: 25
Originally posted by Max longbeach:
can anyone help me here, please ?
It's urgent


This looks like a good starting point: http://www.dynamoo.com/technical/ascii-ebcdic.htm
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 690
    
    1
To convert one byte to another:
Create a 256 byte table with the target values and use the source value as an index.
For example say you want to map x01 to x07:
 
jQuery in Action, 2nd edition
 
subject: ASCII TO EBCDIC: how ?