Chapter Contents

Previous

Next
FIRSTOBS=

FIRSTOBS=



Causes processing to begin at a specified observation

Valid in: DATA step and PROC steps
Category: Observation Control
Restriction: Use with input data sets only.


Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

FIRSTOBS=n

Syntax Description

n
is a positive integer that is less than or equal to the number of observations in the data set.


Details

The FIRSTOBS= data set option is valid when an existing SAS data set is read. You cannot use this option when a WHERE statement or WHERE= data set option is specified in the same DATA or PROC step.


Comparisons


Examples

This PROC step prints the data set STUDY beginning with observation 20:

proc print data=study(firstobs=20);
run;

This SET statement uses both FIRSTOBS= and OBS= to read only observations 5 through 10 from the data set STUDY. Data set NEW contains six observations.

data new;
  set study(firstobs=5 obs=10);
run;

See Also

Data Set Options:

OBS=

Statements:

INFILE
WHERE

System Options:

FIRSTOBS=


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.