# Special characters ▒ on screen

**URL:** <https://techcommunity.softwareag.com/t/special-characters-on-screen/235038>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural\
**Created:** [November 13, 2020, 6:33pm UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038 "2020-11-13T18:33:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Gomez1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ricardo_gomez1/32/7963_2.png) [@Ricardo\_Gomez1](https://techcommunity.softwareag.com/u/Ricardo_Gomez1)\
**Post date:** [November 13, 2020, 6:33pm UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/1 "2020-11-13T18:33:55Z")

</div>

Hi  
how to convert characters that do not print correctly on screen: ▒

Thank you,  
Cheers

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [November 14, 2020, 12:10am UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/2 "2020-11-14T00:10:40Z")

</div>

Where do they come from and what do you expect them to print as ?

---

<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 14, 2020, 1:18am UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/3 "2020-11-14T01:18:20Z")

</div>

Natural has a MASK function which can check for printable characters.

```auto
DEFINE DATA LOCAL
1 #STRING (A15)
         INIT <H'48656C6C6F2C017468657265212020'> /* 'Hello, there!'
         1 REDEFINE #STRING
  2 #CHAR (A1/15)
1 #I (I4)
END-DEFINE
WRITE 'Before:' #STRING
FOR #I = 1 15
  IF #CHAR (#I) <> MASK (P)
    THEN
      RESET #CHAR (#I)
  END-IF
END-FOR
WRITE ' After:' #STRING
END

```

You may find that you and Natural disagree on some characters. To find those that are printable but don’t pass the MASK test, try this:

```auto
DEFINE DATA LOCAL
1 #I4 (I4) 1 REDEFINE #I4
* 2 FILLER 3X /* for Big Endian
  2 #CHAR (A1)
END-DEFINE
FOR #I4 = 0 255
  IF #CHAR = MASK (P) /* Printable?
    THEN
      WRITE 'Yes' #CHAR #CHAR (EM=H)
    ELSE
      WRITE 'No ' #CHAR #CHAR (EM=H)
  END-IF
END-FOR
END

```

If you need to define your own set of non-printable characters:

```auto
DEFINE DATA LOCAL
1 #BAD-ALL (A32)
         INIT <H'000102030405060708090A0B0C0D0E0F'
              -H'101112131415161718191A1B1C1D1E1F'
              >
         1 REDEFINE #BAD-ALL
  2 #BAD (A1/32)
1 #STRING (A15)
         INIT <H'48656C6C6F2C017468657265212020'> /* 'Hello, there!'
END-DEFINE
WRITE 'Before:' #STRING
EXAMINE #STRING FOR #BAD (*) REPLACE ' '
WRITE ' After:' #STRING
END

```

---

<div class="post-metadata">

**Author:** ![Ricardo\_Gomez1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ricardo_gomez1/32/7963_2.png) [@Ricardo\_Gomez1](https://techcommunity.softwareag.com/u/Ricardo_Gomez1)\
**Post date:** [November 14, 2020, 2:58pm UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/4 "2020-11-14T14:58:27Z")

</div>

> [@wolfgang.winter](#):
>
> Where do they come from and what do you expect them to print as ?

Thanks, I’ll try the exercise

---

<div class="post-metadata">

**Author:** ![Ricardo\_Gomez1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ricardo_gomez1/32/7963_2.png) [@Ricardo\_Gomez1](https://techcommunity.softwareag.com/u/Ricardo_Gomez1)\
**Post date:** [November 14, 2020, 2:59pm UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/5 "2020-11-14T14:59:28Z")

</div>

I get the character from a query and I need to see it on the screen; but I don’t know its content

---

<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, 3:45pm UTC](https://techcommunity.softwareag.com/t/special-characters-on-screen/235038/6 "2021-04-02T15:45:24Z")

</div>


