Can someone explain me :
If #a ^= mask §
Can someone explain me :
If #a ^= mask §
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.
^= is equivalent of
The Natural “chameleon syntax”
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)
Never heard about that ^-Operator :shock:
To appaer much more clever use the following code instead of a simple EQ-Operator:
if 1 ^> 1 and 1 ^< 1 write 'X' end-if
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. "
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.
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
But where it originated from was a mystery to me until this morning…
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.
It is currently legal and documented:
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!
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.
Followed the link. I could not find ^ anywhere in the table. I did find ¬=.
Back to the original question, you can read an article I wrote last year at:
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)
FOR #X = 0 TO 255
MOVE #X TO #BIN-CHAR
IF #ALPHA-CHAR = MASK§
MOVE TRUE TO PRINTABLE
MOVE FALSE TO PRINTABLE
IF #ALPHA-CHAR = MASK(S)
MOVE TRUE TO SPECIAL
DISPLAY #X ‘Char’ #ALPHA-CHAR ‘Bin’ #BIN-CHAR
5X PRINTABLE (EM=NO/YES) SPECIAL (EM=NO/YES)