Specifies specific conditions to use to select rows from a data set.
Valid in: | DATA and PROC steps |
Category: | Observation Control |
Restriction: | Cannot be used with the POINT= option in the SET and MODIFY statements. |
Supports: | All |
is an arithmetic or logical expression that consists of a sequence of operators, operands, and SAS functions. An operand is a column, a SAS function, or a constant. An operator is a symbol that requests a comparison, logical operation, or arithmetic calculation. The expression must be enclosed in parentheses.
can be AND, AND NOT, OR, or OR NOT.
data sales; input product $ sales store $; datalines; gizmo 234 parkview gizmo 303 central gizmo 124 mountain gizmo 524 lakeside whizmo 234 mountain whizmo 273 lakeside whizmo 234 parkview whizmo 233 central spintop 23 parkview spintop 83 central spintop 22 mountain spintop 44 lakeside ;
data myfiles.whizmo; set myfiles.sales (where=(product='whizmo')); run;
proc print data=myfiles.whizmo; title 'whizmo data set'; run;
data myfiles.whizmo (where=(product='whizmo')); set myfiles.sales; run;
proc print data=myfiles.whizmo; title 'whizmo data set'; run;