View previous topic :: View next topic
|
Author |
Message |
SyntelShinto
New User
Joined: 30 May 2007 Posts: 10 Location: Mumbai
|
|
|
|
Hi All,
I need to convert a 2 Byte HEX value into a 3 Byte Alphanumeric value
Please help me on the same.
For example my input is hex'C1C2'
I need to display it in 3 byte alphanumeric like ' AB' |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
what is the problem in this?
if you have x'c1c2' two bytes, what is the defn of this?
if x(02) then move it to x(03) justified right and display. |
|
Back to top |
|
|
SyntelShinto
New User
Joined: 30 May 2007 Posts: 10 Location: Mumbai
|
|
|
|
Hi Abhijit,
I think i mentioned worngly, My requirement is to convert the HEX value into the corresponding Decimal value and display it.
Like if we are passing X'FF' it should convert to decimal equivalent of 255.
Could you please suggest, |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Looks like a totally new question to me, but still, where is the problem?
try this-
Code: |
77 hex-var pic x(02) value x'00ff'.
77 num-var redefines hex-var pic 9(04) comp.
display num-var. |
|
|
Back to top |
|
|
SyntelShinto
New User
Joined: 30 May 2007 Posts: 10 Location: Mumbai
|
|
|
|
Thanks Abhijit Now i got it ...., |
|
Back to top |
|
|
|