SAS Data Set Options |
Valid in: | DATA step and PROC steps |
Category: | Observation Control |
Syntax | |
Syntax Description | |
Details | |
Examples | |
Example 1: Accepting Updates That Do Not Match the WHERE Expression | |
Example 2: Rejecting Updates That Do Not Match the WHERE Expression | |
See Also |
Syntax |
WHEREUP=NO | YES |
does not evaluate added observations and modified observations against a WHERE expression.
evaluates added observations and modified observations against a WHERE expression.
Details |
Specify WHEREUP=YES when you want any added observations or modified observations to match a specified WHERE expression.
Examples |
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.
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.