Chapter Contents |
Previous |
Next |
SAS/ACCESS Software for PC File Formats: Reference |
This chapter focuses on the terms and concepts that help you access DBF files with SAS/ACCESS software. Then it describes DBF-specific statements you use in the ACCESS and DBLOAD procedures. Finally, it also contains a section on how the SAS/ACCESS interface works.
Note: The SAS/ACCESS interface cannot access
DBF files created by Visual dBASE 7.
The SAS/ACCESS interface works with DBF files that are created by dBASE (II, III, III PLUS, IV, and 5.0) and with DBF files that are created by other software products.
As an introduction to DBF files, this chapter describes DBF files that are created using dBASE 5.0, rather than describing each version of dBASE and the differences among them.(footnote 1) If you want more information on a dBASE concept or term, see the dBASE documentation packaged with your system.
DBF Files |
A DBF file contains data that are organized in a tabular format of database fields and records. Each database field can contain one type of data, and each record can hold one data value for each field. DBF File illustrates four database fields from CUSTOMER.DBF and highlights a database field and a record.
The SAS/ACCESS interface uses database files that have a .DBF extension. A DBF file consists of a specific number of database fields and some number of records. DBF files are one kind of file that you can select in a catalog. You can create DBF files in a number of ways in dBASE, including using the CREATE command. See your dBASE or other software products' documentation for information about creating DBF files and assigning field names, field types, and other attributes.
The ACCESS procedure uses SAS/ACCESS descriptor files to reference DBF files for reading or extracting data. It cannot use any dBASE indexes or indexes created by other software products that are defined on the fields in a DBF file. You can use the view descriptors you create to update DBF data. You can use the DBLOAD procedure to create and load DBF files.
The ACCESS procedure cannot reference DBF files that
are secured through encryption. Like other files, DBF files are subject to
any security restrictions imposed by the operating system or network (if applicable).
path='c:\sasdemo\library\customer99.dbf';
) However, some applications
that support dBASE files might not accept files with long names.
DBF File Data Types |
dBASE Version | N,n |
---|---|
dBASE II | 16,14 |
dBASE III | 19,15 |
dBASE III PLUS | 19,15 |
dBASE IV | 20,18 |
dBASE 5.0 | 20,18 |
Numeric field types always preserve the precision of their original numbers. However, the SAS System stores all numbers internally as double-precision, floating-point numbers, so their precision is limited to 16 digits.
Note: If every available digit in a DBF
file field is filled with a
9
, the value of the field is interpreted as missing by the SAS System.
If a field in the SAS System indicates a missing value (represented by a
period), the SAS System writes a 9 for each available digit in the corresponding
DBF file database field. While in a SAS session, if you fill every available
digit in a DBF file field with 9s, scroll from the field, and return to the
field, the value is represented as missing.
Dates in DBF files can be subtracted from one another, with the result being the number of days between the two dates. A number (of days) can also be added to a date, with the result being a date.
dBASE also has data types called Memo, General, binary, and OLE, which are stored in an associated memo text file (called a DBT file), but these data types are not supported in the SAS/ACCESS interface to PC file formats.
How the SAS/ACCESS Interface Works describes how the DBLOAD procedure determines data types when creating DBF files.
ACCESS Procedure Data Conversions |
DBF File Data Type | SAS Variable Format |
---|---|
Character(n) | $n .(n
<= 200) $200. (n > 200) |
Numeric(N,n) | (N,n) |
Float(N,n)* | (N,n) |
Date | MMDDYY8. |
Logical | $1. |
*This data type applies to dBASE IV and later. Check with other software products' documentation to see if this data type applies. |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.