Chapter Contents

Previous

Next
SAS/ACCESS Software for PC File Formats: Reference

ACCESS Procedure: DBF Specifics

ACCESS Procedure Reference describes the generic options and procedure statements that enable you to create access descriptors, view descriptors, and SAS data files from PC file format data. The following section describes the PC file-specific statements that you use in the SAS/ACCESS interface to DBF files.


ACCESS Procedure Statements for DBF Files

To create an access descriptor, you use the DBMS=DBF option and the database-description statement PATH=. This PATH= statement supplies DBF-specific information to the SAS System and must immediately follow the CREATE statement. In addition to the database-description statements, you can use optional editing statements when you create an access descriptor. These editing statements must follow the database-description statements.

Database-description statements are only required when you create access descriptors. Because the DBF information is stored in an access descriptor, you do not need to repeat this information when you create view descriptors.

The SAS/ACCESS interface to DBF allows the following procedure statements:

Note:   The SAS/ACCESS interface cannot read DBF files that are encrypted. Therefore, you cannot define an access descriptor based on these files.  [cautionend]

PROC ACCESS options;
CREATE libref.name.ACCESS|VIEW;
UPDATE libref.name.ACCESS|VIEW;
PATH= 'path-and-filename<.DBF>'|<'>filename<'>| fileref;
ASSIGN | AN <=> YES | NO;
DROP <'>column-identifier-1<'> <...<'>column-identifier-n<'>>;
FORMAT <'>column-identifier-1<'><=>SAS-format-name-1
<...<'>column-identifier-n<'> <=>SAS-format-name-n>;
LIST <ALL | VIEW | <'>column-identifier<'>>;
RENAME <'>column-identifier-1<'><=>SAS-variable-name-1
<...<'>column-identifier-n<'><=>SAS-variable-name-n>;
RESET ALL | <'>column-identifier-1<'>
<...<'>column-identifier-n<'>>;
SELECT ALL | <'>column-identifier-1<'>
<...<'>column-identifier-n<'>>;
SUBSET selection criteria;
UNIQUE <=> YES | NO;
RUN;

The QUIT statement is also available in PROC ACCESS. 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.

The following example creates an access descriptor and a view descriptor based on DBF file data.

options linesize=80;
libname dbfliba 'SAS-data-library';
libname dbflibv 'SAS-data-library';

proc access dbms=dbf;
/* create access descriptor */
   create adlib.custs.access;      
   path='c:\dbfiles\dbcusts.dbf';
   assign=yes;
   rename customer = custnum;
   format firstorder date9.;
   list all;

/* create usacust view      */
   create vlib.usacust.view;          
   select customer state zipcode name
          firstorder;
run;


Chapter Contents

Previous

Next

Top of Page

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