Import DBF in SAS

There are several ways to import DBF files in SAS. First, there is PROC DBF:

filename dbfin 'employee.dbf';
	proc dbf db5=dbfin out=employee;

But in my environment (SAS 9.1.3 Windows XP; and SAS 9.2 on Windows Server 2008 with Enterprise Guide 4.2 on Windows XP) this gives the error ERROR: Procedure DBF not found.

Another way is to use PROC IMPORT:

proc import 

But that gives me ERROR: DBMS type DBF not valid for import. These errors probably either mean I didn’t install something during the (long and tedious) SAS installation, or I don’t have the proper license from SAS.

The simplest, quickest solution is to use the %dbf2sas macro written by Richard Hockey.

%include ""; /* download this file using the link above */
%dbf2sas(in=employee.dbf, out=employee);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s