# if KEY PF3 is ON

**URL:** <https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-on-Windows-Unix\
**Created:** [May 16, 2008, 2:15pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740 "2008-05-16T14:15:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 16, 2008, 2:15pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/1 "2008-05-16T14:15:33Z")

</div>

Hello all!

Is there any posibilty to find find out at runtime, if a specific key is on/off?  
Like that:

```auto
if KEY PF3 is OFF
  ...
else
  set KEY PF3=ON
end-if
```

Thanks,

Matthias

---

<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:** [May 16, 2008, 3:42pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/2 "2008-05-16T15:42:08Z")

</div>

Hi Matthias;

Are you just referring to whether or not a key is Program Sensitive in a single program? If so, you could set a flag when you do the SET KEY statement.

I presume, however, you are dealing with multiple objects at different levels. This gets messy. You could pass “flags” from object to object, but that is clearly messy, especially if the objects already exist.

Using Global Variables for flags might be a valid approach. HOWEVER, this would require centralized control/knowledge of all the objects. A subprogram written by another person/group could establish a PF key without the knowledge of the project team.

Perhaps a change enhancement request?

steve

---

<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:** [May 16, 2008, 4:19pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/3 "2008-05-16T16:19:56Z")

</div>

Hi Matthias;

Just to save you time if you haven’t already tried this path.

I thought about “trapping” a NAT1011 which is an unassigned PF/PA key, in an ON ERROR clause. This does not work because Natural “acts” on the error before control gets returned to the program.

Interesting though. Since Natural knows enough to issue the 1011, clearly it has a table of assignments for the keys. Perhaps this could be made available through a USR.

steve

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 16, 2008, 5:49pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/4 "2008-05-16T17:49:06Z")

</div>

Thanks for answering!

> [@Steve Robinson](#):
>
> I thought about “trapping” a NAT1011 which is an unassigned PF/PA key, in an ON ERROR clause. This does not work because Natural “acts” on the error before control gets returned to the program.

Do you mean a SET CONTROL ‘%K03’… INPUT combination? Nice idea!!

> [@](#):
>
> Perhaps a change enhancement request?

ACK

---

<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:** [June 4, 2008, 12:19pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/5 "2008-06-04T12:19:28Z")

</div>

Hi Matthias,

perhaps the API USR4005N does what you’re looking for.

---

<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:** [June 4, 2008, 12:44pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/6 "2008-06-04T12:44:11Z")

</div>

Hi Matthias,

perhaps the API USR4005N does what you’re looking for.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [June 4, 2008, 3:00pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/7 "2008-06-04T15:00:41Z")

</div>

There’s no USR4005 on Windows / Solaris (both Vers. 6.1.1) ☹

---

<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:49pm UTC](https://techcommunity.softwareag.com/t/if-key-pf3-is-on/76740/8 "2021-04-02T14:49:28Z")

</div>


