As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Tips:DATA Step Comparison Operators Are Non-Associative"

From sasCommunity
Jump to: navigation, search
(gardening)
m
 
Line 17: Line 17:
 
<!-- Please do not edit below this line, EXCEPT when promoting a tip -->
 
<!-- Please do not edit below this line, EXCEPT when promoting a tip -->
 
<div style="float:right">Submitted By [[User:Chang y chung|chang_y_chung]]</div>
 
<div style="float:right">Submitted By [[User:Chang y chung|chang_y_chung]]</div>
 +
 
<noinclude>
 
<noinclude>
 
[[Category:Tip in Use]]
 
[[Category:Tip in Use]]
 
[[Category:Expressions]]
 
[[Category:Expressions]]
 
</noinclude>
 
</noinclude>

Latest revision as of 14:08, 16 October 2017

In a DATA step, a logical expression like:

  x < y < z < a

is evaluated as in math. i.e., it is equivalent to:

  x < y and y < z and z < a

In macros, i.e., within %eval() or %sysevalf(), the comparison operators are left-associative. i.e., the above is equivalent to:

  ((x < y) < z) < a
Submitted By chang_y_chung