Hi Friends - I am using sas 9.1 and have mdb 97-2003.
I am importing mdb files into sas dataset in work library and then exporting that sas dataset into mdb file into another folder using below code. But i am getting an error saying that
"ERROR: FILE= or TABLE= is required and must be specified"
but same code working for .xls file
Can someone help me to figure what's wring with my code please!!!
Thanks!
libname a 'f:\sam\a'; /*test.mdb file is here*/
libname b 'f:\sam\b'; /*getting same mdb file here*/
proc import datafile='f:\sam\a\test.mdb'
out=abc
dbms=access replace;
run;
proc export data=abc
outfile='f:\sam\b\tets.mdb'
dbms=access replace;
run;
SAS/ACCESS(R) 9.3 Interface to PC Files: Reference See datatable as being different between Excel/Access
Or http://support.sas.com/techsup/technote/ts793.pdf for 9.1.3 and higher examples.
Basically you are missing the datatable="access table name" parameter.
I am using below code but still not working,
proc import out=abc
datatable='xyz'
dbms=access replace;
database='f:\sam\a\xyz.mdb';
run;
getting error like,
ERROR: file= or table= is required and must be specified.
Don't know what is missing...
you have an extra semicolon after 'replace'.
more surprisingly - if i use IMPORT wizard - it's working fine...:-)
try this,
proc import datafile='f:\sam\a\test.mdb'
datatable="&table_name"
out=abc
dbms=access replace;
run;
proc export data=abc
outfile='f:\sam\b\tets.mdb'
outtable="&table_name"
dbms=access replace;
run;
Than you can save the source the wizard generates and compare that whith what you have tried.
Hi Vish -
i think we cannot mention file= and table= options at same time - you will get an error...
%let table_name=test.mdb;
proc import datafile='f:\sam\a\test.mdb'
datatable="&table_name"
out=abc
dbms=access replace;
run
Thanks all for posting your comments on my issue...I am good for now...
I run same piece of code on different server and it absolutely fine - nothing wrong at all but i am still getting an error where i was running previously.
%let table_a=f:\sandip\a\xyz.mdb;
%let table_b=f:\sandip\b\xyz.mdb;
options symbolgen;
proc import
out=def
datatable="xyz"
dbms=access replace;
database="&table_a";
run;
proc export data=def
outtable="xyz"
dbms=access replace;
database="&table_b";
run;
/*-----------this code ran fine with different server------------Thanks a lot---------------*/
Sounds like a wrong error message as you are pointing now to an inconsistent machine installation.
That is an other issue type. Good that you are able to continue the work.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.