Chapter Contents

Previous

Next
SAS/ACCESS Software for PC File Formats: Reference

DBLOAD Procedure: DBF Specifics

DBLOAD Procedure Reference describes the generic options and procedure statements that enable you to create a PC data file. The following section describes the file-specific statements you use in the SAS/ACCESS interface to DBF files.


DBLOAD Procedure Statements for DBF Files

To create and load a DBF table, the SAS/ACCESS interface to PC file formats uses the following statements:

PROC DBLOAD <DBMS=DBF> <DATA=<libref.>SAS-data-set>;
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;
LIST <ALL | 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. However, its use causes the procedure to terminate. QUIT is used most often in the interactive line and noninteractive modes to exit the procedure without exiting SAS.

VERSION= dBASE-product-number
specifies the number of the dBASE product you are using, such as dBASE IV. The dBASE-product-number argument can be one of the following values: II, III, IIIP, IV, V, 2, 3, 3P, 4, 5. The statement's default value is V.

Specify VERSION= before the TYPE statement in order to get the correct data types for your new .DBF table.

The following example creates a new .DBF table, EXCHANGE.DBF, from the data file DLIB.RATEOFEX . An access descriptor DBFLIBA.EXCHANGE is also created, based on the new table. You must be granted the appropriate privileges in order to create new DBF tables.

libname dbfliba 'SAS-data-library';
libname dbflibv 'SAS-data-library';

proc dbload dbms=dbf data=dlib.rateofex;
   path='c:\dbfiles\sasdemo\exchange.dbf';
   accdesc=adlib.exchange;
   rename fgnindol=fgnindolar 4=dolrsinfgn;
   type country='char(25)';
   load;
run;

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.

The following example defines the data types for several database fields. Notice that you can specify the length of the data type.

proc dbload dbms=dbf data=employee;
  path='c:\sasdemo\employee.dbf';
  rename firstname = fname;
  type   empid     = 'numeric(6)'
         hiredate  = 'date'
         salary    = 'numeric(10,2)'
         jobcode   = 'numeric(5)';
  run;


Chapter Contents

Previous

Next

Top of Page

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