# logical condition mask(P)

**URL:** <https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-on-Windows-Unix\
**Created:** [September 7, 2009, 11:23am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155 "2009-09-07T11:23:23Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [September 7, 2009, 11:23am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/1 "2009-09-07T11:23:23Z")

</div>

Hi,

Can someone explain me :  
If #a ^= mask (p)

---

<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:** [September 7, 2009, 3:22pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/2 "2009-09-07T15:22:07Z")

</div>

Hi Hezi;

P (probably an abbreviation for Printable) includes the four categories U (upper case alphabetic), L (lower case alphabetic) N (numeric) and S (Special Character).

You would have to check with your DBA to see what constitutes your special characters.

As for the ^= . This appears nowhere in the documentation that I can find. Played with it a bit. Seems to be the equivalent of GE, but am not sure yet.

steve

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [September 7, 2009, 3:45pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/3 "2009-09-07T15:45:33Z")

</div>

^= is equivalent of  
Not Equal  
or  
Not =  
or  
\<\>  
or …

The Natural “chameleon syntax” 😉

---

<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:** [September 7, 2009, 3:57pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/4 "2009-09-07T15:57:11Z")

</div>

Also, NE

I am guessing now; Hezi, was this code in production somewhere?

Very annoying when someone discovers undocumented syntax, then proceeds to use it in production just to appear clever.

Better is to report the syntax to Software AG, who will either document it, or change code so that the undocumented syntax is now illegal. (perhaps there was a reason the syntax was not allowed)

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:** [September 7, 2009, 5:10pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/5 "2009-09-07T17:10:24Z")

</div>

Never heard about that ^-Operator :shock:

> [@Steve Robinson](#):
>
> Very annoying when someone discovers undocumented syntax, then proceeds to use it in production just to appear clever.

To appaer much more clever use the following code instead of a simple EQ-Operator:

```auto
if 1 ^> 1 and 1 ^< 1
write 'X'
end-if
```

😉

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [September 8, 2009, 12:59pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/6 "2009-09-08T12:59:21Z")

</div>

Hi Steve - you sent me googling 😉

A qualified guess could be that it is a workaround in connection with NDB ?!

"The DB2 precompiler changes the logical not sign to the circumflex accent because the logical not symbol is a 2-byte character (X’C2AC’) in Unicode, and the circumflex accent is a single byte character (X’5E’) in Unicode. "

from [Parser changes the logical not sign character to the circumflex accent character.](http://www-01.ibm.com/support/docview.wss?uid=swg21306736)

---

<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:** [September 8, 2009, 4:49pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/7 "2009-09-08T16:49:33Z")

</div>

Hi Finn;

Thanks; followed your link. I must confess, I do not find \<\> more readable than NE. Of course, NE is an english abbreviation, and I speak english. I appreciate the fact that programmers who are not fluent in english might prefer a language independent set of operators.

I also use the word “not” rather than the logical not symbol. Reason? The symbol is not on my keyboard. Perhaps that is why the use of ^ is permitted; it is probably on more keyboards (it is on mine) than the logical not symbol.

However, regardless of the philosophy of whether or not ^ should be permitted; if it is permitted, it should be documented.

steve

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [September 8, 2009, 5:33pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/8 "2009-09-08T17:33:34Z")

</div>

Hi Steve,  
Totally agree it should be documented (or not there at all)

But I have seen it at several of our customers here in the Nordic, so for me it was obvious what it meant - although I would never dream of using it myself 😉

- give me “NE” or “\<\>” anyday - but then again Pascal and COBOL was where I came from before Natural !

But where it originated from was a mystery to me until this morning…  
Finn

---

<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:** [September 9, 2009, 12:34am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/9 "2009-09-09T00:34:08Z")

</div>

Perhaps due to my Fortran beginnings, I have always preferred the scientific representations (eg “\>=”, “\<=”, and “¬=”) to the English abbreviations.

Even before the advent of Natural for Windows, I often used a PC to transfer source code between mainframes (remember diskettes?). This required FTP processes which translated the code from EBCDIC to ASCII and back again. This translation wasn’t strictly necessary, but allowed me to view and verify the code while on the PC platform.

There I discovered that I could not rely on the translation of the “not” character. Windows would see a caret (“^”), and this was not converted back to a “not” upon upload. (Natural for Windows treats the caret as a “not”, so the code compiles.) That is when I began using “\<\>” instead of “¬=” to mean not equal (NE).

It is nice to see that the caret is accepted on the mainframe (tested with Nat423), eliminating my translation/upload problem, but I don’t recall seeing an announcement of this enhancement in the Release Notes.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [September 10, 2009, 2:00am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/10 "2009-09-10T02:00:36Z")

</div>

It is currently legal and documented:  
[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/pg/pg\_furth\_lcc.htm#Rel\_Expression](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/pg/pg_furth_lcc.htm#Rel_Expression)

I remember using ¬= (not-sign equals) back in Natural 1, particularly since this character wandered off the keyboard when we transitioned from 3270 terminals to PC’s with terminal emulation (and I remember having issues like Ralph cites). We also had to switch to NE at one customer site as the terminal reader for the blind couldn’t handle the not-sign ¬.

So I don’t know that it was never documented back then (anybody have printed manuals around??), but I’m fairly sure it wasn’t just someone being clever!

---

<div class="post-metadata">

**Author:** ![Curtis\_Pew](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Curtis\_Pew](https://techcommunity.softwareag.com/u/Curtis_Pew)\
**Post date:** [September 11, 2009, 1:53am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/11 "2009-09-11T01:53:01Z")

</div>

On a standard US ASCII keyboard, the caret is shift-6, which is just where the not sign was on 3270 keyboards. So at least you didn’t lose your muscle memory.

---

<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:** [September 11, 2009, 3:10am UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/12 "2009-09-11T03:10:08Z")

</div>

Hi Douglas;

Followed the link. I could not find ^ anywhere in the table. I did find ¬=.

steve

---

<div class="post-metadata">

**Author:** ![The\_WIZ](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@The\_WIZ](https://techcommunity.softwareag.com/u/The_WIZ)\
**Post date:** [September 14, 2009, 10:00pm UTC](https://techcommunity.softwareag.com/t/logical-condition-mask-p/91155/13 "2009-09-14T22:00:29Z")

</div>

Back to the original question, you can read an article I wrote last year at:

[http://www.naturalconference.com/Nattips/Nat-tip-05-12-2008.html](http://www.naturalconference.com/Nattips/Nat-tip-05-12-2008.html)

Also, you don’t have to ask your DBA, mainly because they would be just as surprised as you might be. It is installation dependent; you can test your environment with the following:

DEFINE DATA LOCAL  
1 #BIN-CHAR (B1)  
1 REDEFINE #BIN-CHAR  
2 #ALPHA-CHAR (A1)  
1 #X (I2)  
1 PRINTABLE (L)  
1 SPECIAL (L)  
END-DEFINE  
\*  
FOR #X = 0 TO 255  
MOVE #X TO #BIN-CHAR  
IF #ALPHA-CHAR = MASK(P)  
MOVE TRUE TO PRINTABLE  
ELSE  
MOVE FALSE TO PRINTABLE  
END-IF  
IF #ALPHA-CHAR = MASK(S)  
MOVE TRUE TO SPECIAL  
ELSE  
END-IF  
DISPLAY #X ‘Char’ #ALPHA-CHAR ‘Bin’ #BIN-CHAR  
5X PRINTABLE (EM=NO/YES) SPECIAL (EM=NO/YES)  
END-FOR  
\*  
END

---

<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/logical-condition-mask-p/91155/14 "2021-04-02T14:57:28Z")

</div>


