Chapter Contents

Previous

Next
SAS/ACCESS Software for PC File Formats: Reference

How the SAS/ACCESS Interface Works

For DBF files, the SAS/ACCESS interface is a read-write interface. When you use the ACCESS procedure to create an access descriptor, the SAS System retrieves descriptive information about the database fields directly from the DBF file. When you create a view descriptor, the SAS System retrieves information from the access descriptor without reading the DBF file again.

If the structure of a DBF file changes--for example, database fields are deleted--these changes do not appear in the access descriptor that you created with the ACCESS procedure. The changes also are not reflected in any view descriptors that created previously on that access descriptor and, therefore, invalidate the view descriptors.

However, if the data in the DBF file change, the updated data do appear when they are retrieved by a view descriptor. Suppose, for example, you have a view descriptor defined on a DBF file, and you add 30 records to that file. When you perform a SAS PRINT procedure using that view descriptor, both the old and new records are displayed.

To perform data manipulation tasks, the interface uses SAS commands and statements. For example, in the ACCESS procedure, you use the SAS WHERE statement to retrieve a subset of records from a DBF file. To sort DBF data, you must first extract the data into a SAS data file, unless you are using the SQL procedure. (The SQL procedure enables you to present output data in a sorted order with the ORDER BY clause in the SELECT statement without extracting the data.) You can extract and sort the DBF file data in one step using the OUT= option in the SORT procedure.

The SAS System does not use dBASE indexes or indexes created by other software products that are defined on fields in a DBF file. However, once you have extracted DBF file data with a view descriptor, you can use the SQL or DATASETS procedure to define SAS indexes on variables in the new SAS data file. Using SAS indexes often enhances the performance of data manipulation and retrieval tasks.

When you use the DBLOAD procedure to create and load a DBF file from a SAS data set, the procedure translates the SAS variable formats into field types that can be used in dBASE or other software products. It stores the file in the path specified by the PATH= statement so that dBASE and other software products can then read data from the newly created DBF file.

When you use a view descriptor in a DATA step to display or edit DBF file data, the SAS System's DBF file interface view engine reads from or writes to the DBF file that is stored in the path you specified.


Chapter Contents

Previous

Next

Top of Page

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