Chapter Contents |
Previous |
Next |
SELECT |
Category: | Control Flow |
Comparisons: | SAS Statement with limitations in SCL |
Syntax | |
Differences in SELECT Statement Execution | |
Example |
Syntax |
SELECT<(select-expression)>;
|
END; |
Type: Character
Type: Character
Type: Character
Differences in SELECT Statement Execution |
For SELECT groups in SCL, WHEN statements of the form WHEN(a1, a2, a3) are not supported. However, the following forms are supported:
OTHERWISE is an optional statement. If OTHERWISE is omitted, and if no WHEN conditions are met, the program halts.
Each WHEN statement implies a DO group of all statements until the next WHEN or OTHERWISE statement. Therefore, the following program is valid:
select(x); when(1) call display('a'); ...optionally, more SCL statements... when(2) call display('b'); ...optionally, more SCL statements... otherwise call display('bad'); ...optionally, more SCL statements... end;
For details about the SELECT statement in the base SAS language, see SAS Language Reference: Dictionary.
Example |
This example shows how to use expressions with the SELECT statement:
select; when(x=1) put 'one'; when(2<x<5) put 'between two and five'; when(x>5 or x<0) put 'other'; end;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.