Differences between Data Files and SAS Views
While the terms SAS data files and SAS views can often be used interchangeably, there
are differences to consider:
The main difference is where the values are stored.
A SAS data file is a type of SAS data set that contains both descriptor information
about the data and the data values themselves. SAS views contain only descriptor
information and instructions for retrieving data that is stored elsewhere. Once the
data is retrieved by SAS, it can be manipulated in a DATA step.
A data file is static. A SAS view is dynamic.
When you reference a data file in a later PROC step, you see the data values as they
were when the data file was created or last updated. When you reference a SAS view
in a PROC step, the view executes and provides an image of the data values as they
currently exist, not as they existed when the view was defined.
SAS data files can be created on tape or on any other storage medium.
SAS views cannot be stored on tape. Because of their dynamic nature, SAS views
must derive their information from data files on random-access storage devices, such
as disk drives. SAS views cannot derive their information from files stored on
sequentially accessed storage devices, such as tape drives.
SAS views are read only.
You cannot write to a SAS view, but some SQL views can be updated.
SAS data files can have an audit trail.
The audit trail is an optional SAS file that logs modifications to a SAS data file. Each
time an observation is added, deleted, or updated, information is written to the audit
trail about who made the modification, what was modified, and when.
SAS data files can have generations.
Generations provide the ability to keep multiple copies of a SAS data file. The
multiple copies represent versions of the same data file, which is archived each time
it is replaced.
SAS data files can have integrity constraints.
When you update a SAS data file, you can ensure that the data conforms to certain
standards by using integrity constraints. With SAS views, you can assign integrity
constraints to the data files that the views reference.
SAS data files can be indexed.
Indexing might enable SAS to find data in a SAS data file more quickly. SAS views
cannot be indexed.
SAS data files can be encrypted.
Encryption provides an extra layer of security to physical files. SAS views cannot be
SAS data files can be compressed.
Compression makes it possible to store physical files in less space. SAS views
cannot be compressed.
The following figure illustrates native and interface SAS data files and their relationship
to SAS views.
Differences between Data Files and SAS Views 617

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.