To create an access descriptor, use the DBMS= DBFMEMO
option and the database-description statement PATH= option. This PATH=
option supplies DBF-specific information to SAS and must immediately
follow the CREATE statement. In addition to the database-description
statement, you can use optional editing statements when you create
an access descriptor. These editing statements must follow the database-description
statement.
The database-description
statement is required only 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.
Note: The
SAS/ACCESS interface cannot read DBF files that
are encrypted. Therefore, you cannot define an access descriptor based
on these files.
The
SAS/ACCESS interface to DBF supports the following
procedure statements:
PROC ACCESS <option(s)>
CREATE <libref.name.>ACCESS|VIEW
PATH=<path-and-filename.DBF>|<filename>|<fileref>
UPDATE libref.name.ACCESS|VIEW
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 the Access procedure. 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.
This example creates
an access descriptor and a view descriptor based on DBF file data.
OPTIONS LINESIZE=80;
LIBNAME adlib 'SAS data-library';
LIBNAME vlib '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.;
LOST all;
/* create usacust view */
CREATE vlib.usacust.view;
SELECT customer state zipcode name
firstorder;
RUN;