# convertion ASCII Character in Decimal Value

**URL:** <https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples\
**Created:** [November 28, 2008, 5:11pm UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633 "2008-11-28T17:11:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauro\_ligoni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mauro\_ligoni](https://techcommunity.softwareag.com/u/mauro_ligoni)\
**Post date:** [November 28, 2008, 5:11pm UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/1 "2008-11-28T17:11:13Z")

</div>

It is possible to convert ASCII Character in Decimal Value using natural v 6.3.3 on open system?  
Anybody can help me?  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [November 28, 2008, 5:57pm UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/2 "2008-11-28T17:57:18Z")

</div>

I am not quite sure what your exact need is; but you should probably be looking at the EXAMINE statement. In particular, EXAMINE TRANSLATE with a user supplied table might be appropriate. If it is one character in particular that you wish to convert you could just EXAMINE for that character and REPLACE with the required character.

steve

---

<div class="post-metadata">

**Author:** ![mauro\_ligoni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mauro\_ligoni](https://techcommunity.softwareag.com/u/mauro_ligoni)\
**Post date:** [November 28, 2008, 7:02pm UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/3 "2008-11-28T19:02:08Z")

</div>

Hy Steve, thanks …  
but i need to examine a string of characters and to obtain for each one the corresponding decimal value.  
All this to calculate (with a particular algorithm) a cesksum of all string  
By  
Mauro

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [November 30, 2008, 4:59am UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/4 "2008-11-30T04:59:51Z")

</div>

Let Natural perform the calculation. Pass your string to USR4011N and it will return a hash value.

---

<div class="post-metadata">

**Author:** ![Curtis\_Pew](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Curtis\_Pew](https://techcommunity.softwareag.com/u/Curtis_Pew)\
**Post date:** [December 3, 2008, 2:33am UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/5 "2008-12-03T02:33:40Z")

</div>

If I understand your question, I think you just need to redefine your character as a B1 field:

```auto
DEFINE DATA LOCAL
1 MY-STRING (A20)
1 REDEFINE MY-STRING
  2 CHAR-VALUEB (B1/1:20)
1 CHAR-VALUE (N3)
1 INDEX (I4)
END-DEFINE
MOVE 'My string' TO MY-STRING
FOR INDEX = 1 TO 20
  MOVE CHAR-VALUEB(INDEX) TO CHAR-VALUE
  WRITE CHAR-VALUE
END-FOR
END
```

On the mainframe (EBCDIC) this outputs:

Page 1 12/02/08 15:11:17

212  
168  
64  
162  
163  
153  
137  
149  
135  
64  
64  
64  
64  
64  
64  
64  
64  
64  
64  
64

---

<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:51pm UTC](https://techcommunity.softwareag.com/t/convertion-ascii-character-in-decimal-value/79633/6 "2021-04-02T14:51:13Z")

</div>


