# Trapping % sign in Natural

**URL:** <https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples, Inside-Natural-and-Performance-Hints, Natural-on-Windows-Unix\
**Created:** [March 10, 2015, 4:59am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974 "2015-03-10T04:59:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rebecca\_Rose\_Flores1](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@Rebecca\_Rose\_Flores1](https://techcommunity.softwareag.com/u/Rebecca_Rose_Flores1)\
**Post date:** [March 10, 2015, 4:59am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/1 "2015-03-10T04:59:59Z")

</div>

We have a search field variable where a user can enter anything. However, if the user enters ‘%’ as a prefix, the program abends because it recognizes it as a terminal command.

Is there anyway for us to catch this?

---

<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:** [March 10, 2015, 8:14am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/2 "2015-03-10T08:14:53Z")

</div>

The two simple options:

- change the terminal character to something else (profile parameter CF), or set it to OFF (at least for “normal” users)

- use the profile parameter ESCAPE=OFF to prevent the terminal character to be intercepted

---

<div class="post-metadata">

**Author:** ![Rebecca\_Rose\_Flores1](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@Rebecca\_Rose\_Flores1](https://techcommunity.softwareag.com/u/Rebecca_Rose_Flores1)\
**Post date:** [March 10, 2015, 9:26am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/3 "2015-03-10T09:26:36Z")

</div>

Thanks Wolfgang. I guess there’s no way to catch it within the program itself? We don’t really want to require users to have to change profile parameters every time they do a search.

---

<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:** [March 10, 2015, 10:13am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/4 "2015-03-10T10:13:18Z")

</div>

No, there is no way of intercepting & ignoring the terminal command character, I’m afraid.

If you can’t change the CF parameter possible workarounds depend on where you need to intercept / ignore it, is the search field in a window only, or on every screen ?

---

<div class="post-metadata">

**Author:** ![Rebecca\_Rose\_Flores1](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@Rebecca\_Rose\_Flores1](https://techcommunity.softwareag.com/u/Rebecca_Rose_Flores1)\
**Post date:** [March 10, 2015, 10:47am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/5 "2015-03-10T10:47:09Z")

</div>

Hi Wolfgang, I think I found the solution. I coded SET GLOBALS CF=| within the program and it worked in trapping the % (not really a solution because now, we have a problem with |).

I wanted to try ESCAPE but can’t seem to make it work. Do you know the correct syntax? These don’t seem to work:

SET GLOBALS ESCAPE=OFF  
SET ESCAPE=OFF  
SET ESCAPE OFF

EDIT:  
Nevermind. I realized that ESCAPE isn’t a session parameter. It’s a dynamic parameter and cannot be coded within the program. But how exactly do you set dynamic parameters?

Thanks for your help, though, Wolfgang. Appreciate it.

---

<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:** [March 10, 2015, 11:51am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/6 "2015-03-10T11:51:10Z")

</div>

To turn it off programmatically you would use

```auto
SET GLOBALS CF=OFF
```

---

<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:** [March 10, 2015, 11:53am UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/7 "2015-03-10T11:53:46Z")

</div>

Note:

Terminal commands issued with SET CONTROL, however, will still work, so in case you have windowing commands, %H or the like assigned to PF keys that won’t break !

---

<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:33pm UTC](https://techcommunity.softwareag.com/t/trapping-sign-in-natural/180974/8 "2021-04-02T15:33:02Z")

</div>


