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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 10115 views
  • 0 likes
  • 3 in conversation