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:Creating a flag avoiding the If ... Then Structure"

From sasCommunity
Jump to: navigation, search
(As suggested to the last reviewer, duplicated to: Category:Tip to be Reviewed)
Line 26: Line 26:
 
<noinclude>
 
<noinclude>
 
[[Category:Tip Awaiting Refinement]]
 
[[Category:Tip Awaiting Refinement]]
 +
[[Category:Tip to be Reviewed]]
 
</noinclude>
 
</noinclude>

Revision as of 22:22, 7 June 2015

When building binary flags in a SAS DATA Step you can avoid the IF-THEN/ELSE structure such as:

IF MIN(x , y) GT 4 THEN flag = 1 ;
                   ELSE flag = 0 ;

by using alternate statement forms:

flag = MIN(x , y) GT 4 ;

or

flag = IFN(MIN(x , y) GT 4 , 1 , 0) ;


....see also

....read more

Submitted By Salvador Ambrosio