To create and load a DBF table,
SAS/ACCESS Interface to PC Files uses the following
statements:
PROC DBLOAD DATA=<libref.SAS
data-set>;
DBMS=DBFMEMO
PATH='path-and-filename.DBF'|<filename>|<fileref>
VERSION=<dBASE-product-number>
ACCDESC=<libref.access-descriptor>
DELETE <variable-identifier-1>... <variable-identifier-n>
ERRLIMIT=<error-limit>
LABEL
LIMIT=<load-limit>;
LISTALL|FIELDS|<variable-identifier>
LOAD
RENAME <variable-identifier-1>=<database-field-name-1>...
<variable-identifier-n><database-field-name-n>
RESET ALL|<variable-identifier-1> ...<variable-identifier-n>
TYPE <variable-identifier-1>=database-field-type-1...<<variable-identifier-n>=
<database-field-type-n>'>
WHERE <SAS
where-expression>
RUN;
The QUIT statement is also available
in PROC DBLOAD. It causes the procedure to terminate. QUIT is used
most often in interactive line mode and batch mode to exit the procedure
without exiting SAS.
The following list provides
detailed information about the DBF-specific statements:
VERSION=
dBASE-version-number
specifies the version
of the dBASE product that you are using, such as dBASE IV. The dBASE-version-number argument
can be one of the following values: II, III, IIIP, IV, V, 2, 3, 3P,
4, and 5. V is the default.
Specify VERSION= before
the TYPE statement in order to get the correct data types for your
new DBF table.
TYPE
variable-identifier-1 = 'database-field-name-1'
<
… variable-identifier-n = 'database-field-name-n'>
specifies a DBF file
data type, which is based on the SAS variable format. The database
field name must be enclosed in quotation marks.
This example defines
the data types for several database fields. You can specify the length
of the data type.
PROC DBLOAD DBMS=DBFMEMO DATA=employee;
PATH='c:\sasdemo\employee.dbf';
RENAME firstname = fname;
TYPE empid = 'numeric(6)'
hiredate = 'date'
salary = 'numeric(10,2)'
jobcode = 'numeric(5)';
RUN;
This example creates
a DBF table, Exchange.Dbf, from the data file DLib.RateOfex. An access
descriptor DbFliba.Exchange is created based on the new table. You
must be granted the appropriate privileges to create DBF tables.
LIBNAME dbfliba 'SAS data-library';
LIBNAME dlib 'SAS data-library';
PROC DBLOAD DBMS=DBF DATA=dlib.rateofex;
PATH='c:\dbfiles\sasdemo\exchange.dbf';
ACCDESC=dbFliba.exchange;
RENAME fgnindol=fgnindolar 4=dolrsinfgn;
TYPE country='char(25)';
LOAD;
RUN;