BookmarkSubscribeRSS Feed
MelissaN
Obsidian | Level 7

I tried to import a access database table to SAS and I used the following syntax. This access database has many tables so I specified the table name in datatable.

proc import

datafile="\File path\Origination Historical Update Utility Access 2007_Melissa.accdb"

datatable=HIST_PRODUCT

out=work.BSCC_HIST_PROD

DBMS=ACCESS

REPLACE;

run;

 

I got the following message:

ERROR: Cannot specify both FILE= and TABLE=.

 

Could you please help to fix this?

Thanks.

3 REPLIES 3
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

how about something like this


libname accdb pcfiles path="\File path\Origination Historical Update Utility Access 2007_Melissa.accdb"; 
data work.BSCC_HIST_PROD;
set accdb.HIST_PRODUCT;
run;

untested.

 

MelissaN
Obsidian | Level 7

Thank you for your response. I tested this out, but look like I have to have Access 64-bit installed on my computer.

ballardw
Super User

Consider:

 

proc import

database="\File path\Origination Historical Update Utility Access 2007_Melissa.accdb"

datatable='HIST_PRODUCT'

out=work.BSCC_HIST_PROD

DBMS=ACCESS

REPLACE;

run;

DATAFILE expects to use a single source such as a CSV file, not something with components such as the possibly many tables inside a database.