Chapter Contents

Previous

Next
OBS=

OBS=



Specifies which observation SAS processes last

Valid in: configuration file, SAS invocation, OPTIONS statement, Systems Options window
Category: Files: SAS files
PROC OPTIONS GROUP= SASFILES


Syntax
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

OBS=n | nK | nM | nG | MIN | MAX | hex

Syntax Description

n
specifies the number of the last observation to process.

If OBS=0 and the NOREPLACE option is in effect, SAS can still take certain actions because it actually executes each DATA and PROC step in the program, using no observations. For example, SAS executes procedures, such as CONTENTS and DATASETS, that process libraries or SAS data sets. External files are also opened and closed. Therefore, even if you specify OBS=0, when your program writes to an external file with a PUT statement, an end-of-file mark is written, and any existing data in the file are deleted.

nK | nM | nG
specifies the number of the last observation to process in kilobytes, megabytes, and gigabytes, respectively.

MIN
sets the number of the last observation to process to 0.

MAX
specifies the maximum number of observations to process. The default value is MAX, which is the largest signed, four-byte integer that is representable in your operating environment.

hex
specifies the number of the last observation to process as a hexadecimal number. This number must be followed by an X.


Details

The OBS= system option specifies which observation from a data set or which record from a raw data file that SAS reads last. You can also use OBS= to control analysis of SAS data sets in PROC steps.

If SAS is processing a file of raw data, OBS= specifies the last line of data to read. SAS counts a line of input data as one observation, even if the raw data for several SAS data set observations are on a single line.

You must specify OBS=MAX to use a WHERE statement or WHERE= data set option.

Operating Environment Information:   The syntax that is shown here applies to the OPTIONS statement. On the command line or in a configuration file, the syntax is specific to your operating environment. For details, see the SAS documentation for your operating environment.  [cautionend]

CAUTION:
Using the OBS= system option determines the last observation that is read for all steps during your current SAS session or until you change the setting. To affect any single file, you can use the OBS= data set option.   [cautionend]


Comparisons
An OBS= specification from either a data set option or an INFILE statement option takes precedence over the OBS= system option.


Examples


See Also

Data Set Options:
FIRSTOBS=
OBS=
REPLACE=
System Option:
FIRSTOBS=


Chapter Contents

Previous

Next

Top of Page

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