Chapter Contents


SAS/ACCESS Software for PC File Formats: Reference

ACCESS Procedure: Creating and Using SAS/ACCESS Descriptor Files

SAS/ACCESS descriptor files are the tools that the SAS System uses to establish a connection to a PC file. To create descriptor files, use the ACCESS procedure. There are two kinds of descriptor files: access descriptors and view descriptors. The following sections give a brief overview of these files.

Access Descriptors

An access descriptor holds essential information about the structure of the PC file that you want to access. For example, you can access the file's format and name, its database field or column names, and its data types. Access descriptors can also contain the corresponding SAS System information such as the SAS variable names and formats. Typically, you have only one access descriptor for each PC file.

An access descriptor only describes a PC file's format and contents to the SAS System; that is, it is a master description file of the PC file for the SAS System. You cannot use an access descriptor in a SAS program. Rather, you use an access descriptor to create other SAS files, called view descriptors, that you use in SAS programs.

View Descriptors

A view descriptor defines some or all of the data that are described by one access descriptor (and, therefore, one PC file). For example, you may want to use only three of nine possible database columns and only some of the rows in a PC file. The view descriptor enables you to do this by selecting the database fields or columns that you want to use and specifying criteria to retrieve only the rows you want. Typically, you create several view descriptors based on one access descriptor, where each view descriptor selects a different subset of the PC file data.

A view descriptor is a SAS data set or, more specifically, a SAS data view. You use a view descriptor in a SAS program much as you would any SAS data set. For example, you can specify a view descriptor in the DATA= statement of a SAS procedure or the SET statement of a DATA step. You can use a view descriptor in a SELECT statement of the SQL procedure to join, for example, the view descriptor's data with SAS data.

You can use a view descriptor to update data directly in some of the PC file formats, such as the DBF file format. For example, you can use a view descriptor to add records or mark records for deletion in a DBF file or to change the values in a DBF file field by using the FSEDIT or SQL procedures. You can also modify DBF file data by specifying a view descriptor in the MODIFY or REPLACE statements in a DATA step. See the "Essentials" section in the appropriate chapter for information on whether a PC file format allows updates.

In some cases, you may also want to create a SAS data file from data stored in a PC file. Using a view descriptor to copy PC file data into a SAS data file is called extracting the data. You can extract PC file data in a number of ways, for example, by specifying a view descriptor when using various methods within the ACCESS procedure. Or you could specify a view descriptor in a DATA step or in a SAS procedure's OUT= option. (See PROC ACCESS Statement Options for information about extracting PC file data.) When you need to use the same PC file data in a number of SAS procedures or DATA steps, extracting the PC file data into a SAS data file might use fewer resources than directly accessing the data repeatedly.

Relationships among a PC File, an Access Descriptor, and View Descriptors illustrates the relationships among a PC file, an access descriptor, and one or more view descriptors.

Relationships among a PC File, an Access Descriptor, and View Descriptors


Interface View Engine: Reading and Sending Data Transparently

All SAS data sets, including view descriptors, use a SAS engine to retrieve data. Each SAS/ACCESS interface has its own interface view engine, which enables it to retrieve or send data between the SAS System and a PC file or database product. Whereas the interface view engine is an integral part of the SAS/ACCESS interface, the interface's design is transparent, so you seldom have to deal directly with the engine.

The name of your interface view engine is stored in SAS/ACCESS descriptor files when you create them. When you specify a view descriptor in a SAS program, the SAS System automatically interacts with the interface view engine to access the PC file data.

Chapter Contents



Top of Page

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