View previous topic :: View next topic
|
Author |
Message |
vishabus
New User
Joined: 25 Oct 2006 Posts: 24 Location: India
|
|
|
|
Hi,
When we do a hex on we are able to see hex values of the data in a file.
An example:
Code: |
0INVOCATION PARAMETERS:
FCDEDCCECDD4DCDCDCECDE7
0955631396507191453592A
|
How is this conversion done? I mean how does a hex C1 represents an 'A'?
I remember doing decimal to hex coversion and vice versa but can someone guide me with the above conversion.
Thanks,
Vishwajeet |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
It is not like converting from decimal to octal or hexadecimal.
C1 is the hex value of the letter "A" in EBCDIC, Do you have a "green card"?
Basically, when a hex value is sent to an EBCDIC aware output device, that hex value is displayed as the appropriate character.
If a hex 43 was sent to an EBCDIC aware output device you would see pretty much nothing, but if that 43 was sent to a ASCII aware output device, you would see the letter "C".
If you are asking questions at this level, fine a green card, it will help a lot. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Vishwajeet,
In both EBCDIC and ASCII systems, one byte is made up of 8 bits, so the value for one byte can be from binary 0000-1111 which is hex 00-FF making 256 possible combinations.
What you see in tso when you turn hex on is the actual character (if it is a displayable character) and the hex value that makes up that character. Each is unique - when you turn hex on, you will NOT see 2 different hex values that show as a C.
The ASCII and EBCDIC character sets are NOT the same which is why there are often issues moving data from one platform to the other.
As to why hex C1 is the capital A - that is the way it was designed.
If you look around on the web, you can find both the ASCII and EBCDIC character sets. If you find info on 7-bit ASCII, you can pretty much skip over that. |
|
Back to top |
|
|
vishabus
New User
Joined: 25 Oct 2006 Posts: 24 Location: India
|
|
|
|
Thanks a lot for your responses William and Scherrer. I had completely forgotten EBCDIC character set funda. I was trying to convert the HEX to DEC and then looking up at ASCII table
Got it now. Thanks for the info |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome |
|
Back to top |
|
|
|