# Binary to Alphanumeric conversion

**URL:** <https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [January 29, 2006, 6:26pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510 "2006-01-29T18:26:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![koolbuddy](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@koolbuddy](https://techcommunity.softwareag.com/u/koolbuddy)\
**Post date:** [January 29, 2006, 6:26pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/1 "2006-01-29T18:26:18Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 30, 2006, 5:31am UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/2 "2006-01-30T05:31:05Z")

</div>

The correct edit mask would be EM=HHHH ( or EM=H(4) ), which converts 4 bytes of hex data to their “string representation”.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 30, 2006, 1:06pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/3 "2006-01-30T13:06:30Z")

</div>

> [@koolbuddy](#):
>
> I want to convert 9B720100 which is binary to alphanumeric one…

Maybe this code is suitable, too:

```auto
#alpha-field := H'9B720100'
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 30, 2006, 9:11pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/4 "2006-01-30T21:11:32Z")

</div>

> [@Matthias](#):
>
> Maybe this code is suitable, too:
> 
> ```auto
> #alpha-field := H'9B720100'
> ```

Nope, this will just put hex (unprintable) characters into #alpha-field, but it won’t generate an “edited” representation of the hex value.

---

<div class="post-metadata">

**Author:** ![koolbuddy](https://avatars.discourse-cdn.com/v4/letter/k/ecd19e/32.png) [@koolbuddy](https://techcommunity.softwareag.com/u/koolbuddy)\
**Post date:** [January 31, 2006, 11:38am UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/5 "2006-01-31T11:38:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter\_Pag](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@Peter\_Pag](https://techcommunity.softwareag.com/u/Peter_Pag)\
**Post date:** [January 31, 2006, 1:49pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/6 "2006-01-31T13:49:13Z")

</div>

To display/write/print you can use

```auto
 DISPLAY var1 (EM=H(4))
```

To move the value in printable form to another alpha variable you can use

```auto
 MOVE EDITED var1 (EM=H(4)) TO var2
```

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 31, 2006, 7:12pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/7 "2006-01-31T19:12:46Z")

</div>

> [@Wolfgang Winter](#):
>
> but it won’t generate an “edited” representation of the hex value.

Sorry, but I thought we talk about conversion and not about representation.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/binary-to-alphanumeric-conversion/60510/8 "2021-04-02T14:40:26Z")

</div>


