Specifies whether to evaluate new observations and
modified observations against a WHERE expression.
Valid in: |
DATA step and PROC steps
|
Category: |
Observation Control
|
-
NO
-
does not evaluate added observations and
modified observations against a WHERE expression.
-
YES
-
evaluates added observations and modified
observations against a WHERE expression.
Specify WHEREUP=YES when you want any
added observations or modified observations to match a specified WHERE expression.
This example shows how WHEREUP= permits observations
to be updated and added even though the modified observation does not match
the WHERE expression:
data a;
x=1;
output;
x=2;
output;
run;
data a;
modify a(where=(x=1) whereup=no);
x=3;
replace; /* Update does not match WHERE expression */
output; /* Add does not match WHERE expression */
run;
In this example, SAS updates the observation and adds the new observation
to the data set.
In this example, WHEREUP= does not permit observations
to be updated or added when the update and the add do not match the WHERE
expression:
data a;
x=1;
output;
x=2;
output;
run;
data a;
modify a(where=(x=1) whereup=yes);
x=3;
replace; /* Update does not match WHERE expression */
output; /* Add does not match WHERE expression */
run;
In this example, SAS does not update the observation nor does it add
the new observation to the data set.
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.