| Language Reference |
marks observations for deletion
| Operand | Example |
| a single record number | point 5 |
| a literal giving several | point {2 5 10} |
| record numbers | |
| the name of a matrix | point p |
| containing record numbers | |
| an expression in parentheses | point (p+1) |
WHERE comparison arguments can be matrices. For the following operators, the WHERE clause succeeds if all the elements in the matrix satisfy the condition:
| ^= ^? < <= > >= |
For the following operators, the WHERE clause succeeds if any of the elements in the matrix satisfy the condition:
| = ? = : = * |
Logical expressions can be specified within the WHERE clause by using the AND (&) and OR (|) operators. The general form is as follows:
| clause&clause | (for an AND clause) | ||
| clause|clause | (for an AND clause) |
where clause can be a comparison, a parenthesized clause, or a logical expression clause that is evaluated by using operator precedence.
Note: The expression on the left-hand side refers to values of the data set variables and the expression on the right-hand side refers to matrix values.
Here are several examples of DELETE statements:
delete; /* deletes the current obs */
delete point 34; /* deletes obs 34 */
delete all where(age<21); /* deletes obs where age<21 */
You can use the SETOUT statement
with the DELETE statement as follows:
setout class point 34; /* makes CLASS current output */
delete; /* deletes ob 34 */
Observations deleted by using the DELETE statement are not physically
removed from the data set until a PURGE statement is issued.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.