Causes processing to end with the nth observation
| Valid in: |
DATA step and PROC steps
|
| Category: |
Observation control
|
| Restriction: |
Use with input data sets only.
|
-
n
-
specifies a positive integer that is less
than or equal to the number of observations in the data set or zero.
-
MAX
-
represents the total number of observations
in the data set.
This option specifies the number of the last observation
to process, not how many observations should be processed. It is valid only
when an existing SAS data set is read.
Use OBS=0 to create an empty data set that has the structure,
but not the attributes, of another data set.
You cannot use the OBS= data set option when a WHERE
statement or WHERE= data set option is specified in the same DATA or PROC
step.
In this example, the OBS= data set option in the SET
statement
reads in the first ten observations from data set OLD:
data new;
set old(obs=10);
run;
This statement prints only observations 5 through 10
in data set STUDY:
proc print data=study(firstobs=5 obs=10);
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.