Desktop productivity for business analysts and programmers

import /export error

Reply
Regular Contributor
Posts: 220

import /export error

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;

Valued Guide
Posts: 3,206

Re: import /export error

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

---->-- ja karman --<-----
Grand Advisor
Posts: 10,210

Re: import /export error

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.

Regular Contributor
Posts: 220

Re: import /export error

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

Valued Guide
Posts: 2,111

Re: import /export error

you have an extra semicolon after 'replace'.

Regular Contributor
Posts: 220

Re: import /export error

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

Frequent Contributor
Posts: 117

Re: import /export error

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;

Valued Guide
Posts: 3,206

Re: import /export error

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

---->-- ja karman --<-----
Regular Contributor
Posts: 220

Re: import /export error

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

Regular Contributor
Posts: 220

Re: import /export error

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

Valued Guide
Posts: 3,206

Re: import /export error

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 --<-----
Frequent Contributor
Posts: 148

Re: import /export error

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
Esteemed Advisor
Posts: 5,198

Re: import /export error

This thread is more than two years old.
Check your syntax.
Data never sleeps
Ask a Question
Discussion stats
  • 12 replies
  • 6592 views
  • 3 likes
  • 7 in conversation