koolbuddy
(koolbuddy)
1
Hi,
I want to convert a binary word to alphanumeric value. How can i do that?
I want to convert 9B720100 which is binary to alphanumeric one…
I used the EM=ZZ but it says out that the edit mask is too long or specified incorrectly…
Waiting for the reply,
system
(system)
2
The correct edit mask would be EM=HHHH ( or EM=H(4) ), which converts 4 bytes of hex data to their “string representation”.
Matthias1
(Matthias)
3
Maybe this code is suitable, too:
#alpha-field := H'9B720100'
system
(system)
4
Nope, this will just put hex (unprintable) characters into #alpha-field, but it won’t generate an “edited” representation of the hex value.
koolbuddy
(koolbuddy)
5
Moving that hexadecimal value to an Alphanumeric variable will give the contents in normal form, as i believe.
Suppose,
#var1 is defined as A4
#var1:=H’9B720100’
This will give the alphanumeric content of the given hexadecimal value which is
›r
Correct me if i am wrong…
Thanks
Peter_Pag
(Peter Pag)
6
To display/write/print you can use
DISPLAY var1 (EM=H(4))
To move the value in printable form to another alpha variable you can use
MOVE EDITED var1 (EM=H(4)) TO var2
Matthias1
(Matthias)
7
Sorry, but I thought we talk about conversion and not about representation.