# Examine to remove numeric characters

**URL:** <https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Mainframes\
**Created:** [August 7, 2022, 5:14am UTC](https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923 "2022-08-07T05:14:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaniv\_Zisano](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/yaniv_zisano/32/17410_2.png) [@Yaniv\_Zisano](https://techcommunity.softwareag.com/u/Yaniv_Zisano)\
**Post date:** [August 7, 2022, 5:14am UTC](https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923/1 "2022-08-07T05:14:17Z")

</div>

I have value ‘01025580029024097’ and i like to do the following:

1. Remove the 7th and 17th (last) characters
2. Add ‘-’ separator in 6,4,3,2 position

010255 ~~8~~ 002902409 ~~7~~

End results should be ‘ **010255-0029-024-09** ’

I’ve tried :

```auto
#TEXT := '01025580029024097'
#POS := 7
#LENG := 1
EXAMINE SUBSTRING(#TEXT,#POS,#LENG) FOR '?' AND DELETE

```

it did not work

---

<div class="post-metadata">

**Author:** ![Harald\_Lohrfink2](https://avatars.discourse-cdn.com/v4/letter/h/7c8e57/32.png) [@Harald\_Lohrfink2](https://techcommunity.softwareag.com/u/Harald_Lohrfink2)\
**Post date:** [August 7, 2022, 6:25am UTC](https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923/2 "2022-08-07T06:25:02Z")

</div>

What about

```
compress

  substring(#text,1,6)
  '-'
  substring(#text,8,4)
  '-'
  substring(#text,12,3)
  '-'
  substring(#text,15,2)

to #text leaving no

```

---

<div class="post-metadata">

**Author:** ![Harald\_Lohrfink2](https://avatars.discourse-cdn.com/v4/letter/h/7c8e57/32.png) [@Harald\_Lohrfink2](https://techcommunity.softwareag.com/u/Harald_Lohrfink2)\
**Post date:** [August 7, 2022, 6:34am UTC](https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923/3 "2022-08-07T06:34:23Z")

</div>

or

```
compress

   substring(#text,1,6)
   substring(#text,8,4)
   substring(#text,12,3)
   substring(#text,15,2)

to #text with delimiter '-'

```

---

<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:** [February 3, 2023, 6:34am UTC](https://techcommunity.softwareag.com/t/examine-to-remove-numeric-characters/259923/4 "2023-02-03T06:34:30Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
