BookmarkSubscribeRSS Feed
sas_9
Obsidian | Level 7

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;

12 REPLIES 12
jakarman
Barite | Level 11

SAS/ACCESS(R) 9.3 Interface to PC Files: Reference See datatable as being different between Excel/Access

---->-- ja karman --<-----
ballardw
Super User

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.

sas_9
Obsidian | Level 7

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...

Doc_Duke
Rhodochrosite | Level 12

you have an extra semicolon after 'replace'.

sas_9
Obsidian | Level 7

more surprisingly - if i use IMPORT  wizard - it's working fine...:-)

Vish33
Lapis Lazuli | Level 10

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;

jakarman
Barite | Level 11

Than you can save the source the wizard generates and compare that whith what you have tried.

---->-- ja karman --<-----
sas_9
Obsidian | Level 7

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

sas_9
Obsidian | Level 7

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---------------*/

jakarman
Barite | Level 11

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. 

---->-- ja karman --<-----
sasprofile
Quartz | Level 8
Hello Friends, I have same kind of issue when am trying to import and export excel files from Grid node to PC file server. below are the codes am using,but not sure where its going wrong. proc export data= sashelp.prdsale; dbms=xls; outfile="D:\pcfile\prdsale.xls"; port=xxxx; server="xxxxxxxxx"; sheet=sheet1; run; proc import dbms=excelcs datafile='D:\pcfile\Demo.xls' out=\tmp REPLACE; port=xxxx; server="xxxxxx"; sheet=sheet1; run; These are the error am getting,any suggestions or advice would be really appreciated. Proc import dbms=excelcs data='D:\pcfile\Demo.xls' ---- 22 76 Error 22-322 Syntax error,expecting onc eof the following: ;,DATAFILE,DATATABLE,DBMS,DEBUG,FILE Error 76-322 Syntax error,statement will be ignored outfile=\tmp REPLACE; port=xxxx; server="xxxxxxx"; run; server proc export data=sashelp.prdsale; Error:FILE or TABLE is required and must be specified. dbms=xls; file="D:\pcfile\prdsale.xls"; port=xxxx; server="xxxxxx"; sheet=sheet1; run; Thank you
LinusH
Tourmaline | Level 20
This thread is more than two years old.
Check your syntax.
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 18526 views
  • 3 likes
  • 7 in conversation