Language Reference |
opens a SAS data set for reading
var {time1 time5 time9}; /* a literal giving the variables */ var time; /* a matrix containing the names */ var('time1':'time9'); /* an expression */ var _all_; /* a keyword */The WHERE clause conditionally selects observations, within the range specification, according to conditions given in the clause. The general form of the WHERE clause is as follows:
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
clause&clause | (for an AND clause) | |
clause|clause | (for an OR 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.
The VAR and WHERE clauses are optional, and you can specify them in any order. If a data set is already open, all the options that the data set was first opened with are still in effect. To override any old options, the new USE statement must explicitly specify the new options. Examples of valid statements follow.
use class; use class var{name sex age}; use class var{name sex age} where(age>10);
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.