Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't SAS support short circuit operator?

Run the code in SAS
data _null_; if 1 or sum(.) then put 'Hi!'; run;
It reports missing value was generated which shows 'or' is not a short circuit operator.
Why doesn't SAS support short circuit operation?

like image 256
whymath Avatar asked Mar 04 '23 09:03

whymath


1 Answers

The strongest argument is for continued proper operation of all legacy SAS code, that knowingly or unknowingly rely on it.

As for the original why, that would be a question for the originators. https://en.wikipedia.org/wiki/SAS_(software)#Origins

There may be un-documented options for causing the DATA Step compiler to generate 'optimized' code that might include shortcut evaluations.

like image 159
Richard Avatar answered Mar 14 '23 23:03

Richard