Previous PageNext Page

The general SELECT/WHEN structure
This form of SELECT-WHEN tests for equality in the identification of mutually exclusive groups.

SELECT-WHEN structures (data step only)
The full form of Select is:
SELECT (select-expression);
     WHEN (when-expression, when-expression, ...) statement;
     ...
     [ WHEN (when-expression, when-expression, ...) statement; ]
     OTHERWISE statement;
END;
SAS first evaluates the select-expression.
Then, each when-expression is evaluated and compared for equality to the value of the select-expression. The first equality that is true causes the execution of the associated statement. If none are true, the statement in the OTHERWISE is executed.

Previous PageTable Of ContentsNext Page