|SAS/ACCESS Software for PC File Formats: Reference|
This chapter introduces SAS System users to DBF files, which can be created using a variety of microcomputer software programs. DBF files are a file format created by dBASE, a relational database management system for microcomputer systems.
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.
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).
Filenames must also follow operating-system specific conventions, so check the documentation that comes with your dBASE product or other software products for further information. The following conventions apply to DBF filenames and field names:
path='c:\sasdemo\library\customer99.dbf';) However, some applications that support dBASE files might not accept files with long names.
|DBF File Data Types|
Every field in a DBF file has a name and a data type. The data type tells how much physical storage to set aside for the database field and the form in which the data are stored. The following section lists and describes each data type.
|dBASE III PLUS||19,15|
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|
The table below shows the default SAS System variable formats that the ACCESS procedure assigns to each DBF file data type. If DBF file data fall outside of the valid SAS data ranges, you get an error message in the SAS log when you try to read the data.
|DBF File Data Type||SAS Variable Format|
$200. (n > 200)
|*This data type applies to dBASE IV and later. Check with other software products' documentation to see if this data type applies.|
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.