Differences between Data Files and Data Views


While the terms "SAS data files" and "SAS data views" can often be used interchangeably, here are a few 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 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 view in a PROC step, the view executes and provides you with 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 data views cannot be stored on tape. Because of their dynamic nature, SAS data views must derive their information from data files on random-access storage devices, such as disk drives. Views cannot derive their information from files stored on sequentially accessed storage devices, such as tape drives .

  • SAS data views are read only . You cannot write to a 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 views, this may only be done indirectly, by assigning 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 data views cannot be indexed.

  • SAS data files can be encrypted. Encryption provides an extra layer of security to physical files. SAS data views cannot be encrypted.

  • SAS data files can be compressed. Compression makes it possible to store physical files in less space. SAS data views cannot be compressed.

The following figure illustrates native and interface SAS data files and their relationship to SAS views.

click to expand
Figure 28.1: Types of SAS Data Sets



SAS 9.1.3 Language Reference. Concepts
SAS 9.1.3 Language Reference: Concepts, Third Edition, Volumes 1 and 2
ISBN: 1590478401
EAN: 2147483647
Year: 2004
Pages: 258

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net