Figure 28.1 Types of SAS Data Sets
SAS Data Views
(contain descriptor
information that points to
data stored elsewhere)
SAS Data Files
(contain data and
descriptor information)
Native Data Files
(formatted by SAS)
Interface Data Files
(formatted by other
software)
Native Data Views
(formatted by SAS)
Interface Data Views
(formatted by other
software)
PROC SQL Views DATA Step Views
SAS Data Sets
Understanding the Observation Count in a SAS
Data File
Definition of the Observation Count
The observation count includes both observations (rows) and deleted observations. The
maximum number of observations that can be counted for a SAS data file is 2
63
–1 or
approximately 9.2 quintillion observations. Exceeding that number is extremely unlikely
for most users.
Backward Compatibility of the Extended Observation Count
Attribute
Overview of the Extended Observation Count Attribute
In SAS 9.2 and earlier releases, the maximum observation count was much lower under
some operating environments. In SAS 9.3, an extended observation count was offered to
users with the option EXTENDOBSCOUNTER=YES. In SAS 9.4 and later releases, the
observation count is extended by default, and SAS has the same maximum observation
count under all environments.
The behavior depends on your operating environment:
Under UNIX environments, by default the EXTENDOBSCOUNTER= option is not
set. The extended observation count feature is not necessary under 64-bit UNIX.
However, if you specify the OUTREP= option, and the data representation is not a
64-bit UNIX operating environment, then SAS automatically sets
EXTENDOBSCOUNTER=YES. SAS adds the extended observation count feature
for compatibility with environments other than UNIX where it might be necessary.
618 Chapter 28 SAS Data Files
(Many customers specify OUTREP= when they create a data set for use in a
different environment. This practice can help you avoid the limitations of CEDA
processing.)
Under Windows and z/OS, by default EXTENDOBSCOUNTER=YES. Files are
created with the enhanced file format and the extended observation count attribute.
When to Use the EXTENDOBSCOUNTER=NO Option
The extended observation count attribute can make data sets unusable in SAS 9.2 and
earlier releases, under certain circumstances. Here is an example of the error message:
ERROR: File MYFILES.EXTEND.Data not compatible with this SAS version.
The behavior depends on your operating environment:
Under UNIX, if you specify OUTREP= and plan to use the file in SAS 9.2 or earlier
releases, specify EXTENDOBSCOUNTER=NO. If you do not specify OUTREP=,
then you do not need to specify EXTENDOBSCOUNTER=NO.
Under Windows or z/OS, if you plan to use the file in SAS 9.2 or earlier releases,
specify EXTENDOBSCOUNTER=NO.
For more information, see the following:
The EXTENDOBSCOUNTER= data set option is documented in SAS Data Set
Options: Reference.
The EXTENDOBSCOUNTER= LIBNAME statement option is documented in SAS
Global Statements: Reference.
The EXTENDOBSCOUNTER= system option is documented in SAS System
Options: Reference.
Viewing the ExtendObsCounter Attribute in CONTENTS Output
When you run PROC CONTENTS or the CONTENTS statement of PROC DATASETS,
you can see the ExtendObsCounter attribute in the output. If a SAS data file does not
contain the extended observation count file attribute, the ExtendObsCounter field is not
listed.
Understanding the Observation Count in a SAS Data File 619
Output 28.1 CONTENTS Procedure Output Showing ExtendObsCounter Attribute
Interactions with the Extended Observation Count
Note the following details:
SAS functionality that copies files (such as the APPEND procedure, COPY
procedure, MIGRATE procedure, and SET statement) does not copy the extended
observation count attribute.
In a SAS/SHARE client session, the EXTENDOBSCOUNTER= option in the
LIBNAME statement is ignored if it is specified in combination with the SERVER=
option.
Exceeding the Maximum Observation Count
SAS Processing When the Maximum Observation Count Is Reached
The observation count includes both observations (rows) and deleted observations. The
maximum number of observations that can be counted for a SAS data file is 2
63
–1 or
approximately 9.2 quintillion observations. When a SAS data file reaches the maximum
observation count, continued SAS processing depends on whether the file has an index
or an integrity constraint that uses an index.
If the SAS data file has an index or an integrity constraint that uses an index (unique
key, primary key, and foreign key), an error message is issued when an operation
reaches the maximum observation count.
A SAS data file is not damaged when an operation attempts to exceed the maximum
observation count. However, you must take explicit action to continue processing the
file.
If the SAS data file does not have an index or an integrity constraint that uses an
index, sequential processing continues and additional observations are accepted.
However, the file cannot store the observation count and does not maintain the
620 Chapter 28 SAS Data Files

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.