Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Beware of the "<>"!

There are some languages in which "<>" means "does not equal", but SAS is not one of them!

In the SAS language, the "<>" is interpreted as "MAX", so any statement using this operator is basically saying "take the highest value from this pair". So for example, the conditional statement "if a <> b" would resolve to "true" whenever either variable was greater than 0.

So the following code will not work quite as expected :

  data _null_;
    a = 2;
    b = 2;
    if a <> b then 
      put "A is NOT Equal to B";
      put "A is Equal to B";

On running this code the following info will be written to the log :

  13   data _null_;
  14     a = 2;
  15     b = 2;
  17     if a <> b then
  NOTE: The "<>" operator is interpreted as "MAX".
  18       put "A is NOT Equal to B";
  19     else
  20       put "A is Equal to B";
  22   run;
  A is NOT Equal to B
  NOTE: DATA statement used (Total process time):
        real time           0.00 seconds
        cpu time            0.00 seconds

As you can see, the data step has written the statement "A is NOT Equal to B", which is obviously incorrect. However, if you look a little harder you will notice the rather helpful "NOTE: The "<>" operator is interpreted as "MAX"." message which informs you of exactly what has happened.