Thursday, April 30, 2009

SAS Operator for Not-Equal

For many programmers, Pascal is the first programming language learnt. In Pascal, the operator <> means not equal.
SAS also has such a <> operator. But, this <> operator does NOT mean not-equal, it means MAX. It simply return the maximum of the 2 values under comparsion.
Actually, the offical not-equal operator in SAS are :
  1. ne
  2. ^=
  3. ¬=
  4. ~=
This is the link for SAS version-8 operators for your reference.
Frankly speaking, this quite odd usage of the <> operator in SAS will easily make some beginners fall into the trap of assuming <> to stand for not-equal. In SAS version-8, you can change the warning level to let the interpreter to issue a warning message when it sees a <> operator to alert the programmer that it is a MAX operator.
Since in real life the usage of getting the maximum using the <> operator is quite rare, my previous working experience is to use a pre-compiler alike construct to scan all SAS program to forbid using the <> operator. This can avoid falling into the trap of mistakenly using it to mean not-equal for everyone in the department. Actually, in SAS, there is a max() function which perform SIMILAR processing as the <> operator.

Duplicate Open Current Folder in a New Window

Sometimes after I opened a folder in Win7, I would like to duplicate open the same folder again in another explorer window. Then, I can ope...