# How to check if a variable contains any special character?

**URL:** <https://techcommunity.softwareag.com/t/how-to-check-if-a-variable-contains-any-special-character/92422>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics, Adabas-Natural-Cloud\
**Created:** [December 21, 2009, 6:39pm UTC](https://techcommunity.softwareag.com/t/how-to-check-if-a-variable-contains-any-special-character/92422 "2009-12-21T18:39:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Susanta](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Susanta](https://techcommunity.softwareag.com/u/Susanta)\
**Post date:** [December 21, 2009, 6:39pm UTC](https://techcommunity.softwareag.com/t/how-to-check-if-a-variable-contains-any-special-character/92422/1 "2009-12-21T18:39:22Z")

</div>

Can anyone tell me how to check if a variable contains any special character? Is there any special system command for the same?

---

<div class="post-metadata">

**Author:** ![Helmut\_Spichtinger](https://avatars.discourse-cdn.com/v4/letter/h/e0b2c6/32.png) [@Helmut\_Spichtinger](https://techcommunity.softwareag.com/u/Helmut_Spichtinger)\
**Post date:** [December 22, 2009, 2:06pm UTC](https://techcommunity.softwareag.com/t/how-to-check-if-a-variable-contains-any-special-character/92422/2 "2009-12-22T14:06:13Z")

</div>

This can be done with the MASK-Option: MASK(S).  
Look at the Natural Programming Guide, chapter 'Logical Condition Criteria".

See also:  
[www.naturalconference.com/Nattips/Nat-tip-05-12-2008.html?submit2222222=Get](http://www.naturalconference.com/Nattips/Nat-tip-05-12-2008.html?submit2222222=Get)

---

<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:57pm UTC](https://techcommunity.softwareag.com/t/how-to-check-if-a-variable-contains-any-special-character/92422/3 "2021-04-02T14:57:53Z")

</div>


