Chapter Contents |
Previous |
Next |
RETURN |
Valid: | in a DATA step |
Category: | Control |
Type: | Executable |
Syntax | |
Without Arguments | |
Details | |
Examples | |
See Also |
Syntax |
RETURN; |
Details |
The point to which SAS returns depends on the order in which statements are executed in the DATA step.
The RETURN statement is often used with the
When RETURN causes a return to the beginning of the DATA step, an implicit OUTPUT statement writes the current observation to any new data sets (unless the DATA step contains an explicit OUTPUT statement, or REMOVE or REPLACE statements with MODIFY statements). Every DATA step has an implied RETURN as its last executable statement.
Examples |
In this example, when the values of X and Y are the same, SAS executes the RETURN statement and adds the observation to the data set. When the values of X and Y are not equal, SAS executes the remaining statements and then adds the observation to the data set.
data survey; input x y; if x=y then return; put x= y=; datalines; 21 25 20 20 7 17 ;
See Also |
Statements:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.