BookmarkSubscribeRSS Feed
robin2
Calcite | Level 5

Hi,

 

I am trying to import data from a Microsoft Access data table that has a table name longer than 32 characters.

 

proc import out = work
datatable = "verylongtablenameherexxxx xxxxxxxxx"
dbms = access replace;
dbpwd = "xxxx";
database = "pathway to mdb";
run;

I get the following error message: ERROR: TABLE value exceeds maximum length of 32 characters.

Is there a way to get around this? I tried using the SQL pass through (which I have never used before) but that also presents an error.

 

proc sql;
connect to access(path="pathway to .mdb"
	dbpwd = "xxxx");
create table work.test as
select * from connection to access
(select * from "verylongtablenameherexxxx xxxxxxxxx");
disconnect from access;
quit;

ERROR: Prepare: Syntax error in query. Incomplete query clause.
SQL statement: select * from "Live Booster Phone calls Information"

Any ideas would be greatly appreciated.

 

Thank you,

Robin

2 REPLIES 2
Reeza
Super User

Pass Through should work. I think your query is wrong though you need to use Access SQL and indicate the book and table name? I think it needs to be in braces or there's some way that Access references tables with spaces in them.

This is the part SAS doesn't like right now:

select * from "verylongtablenameherexxxx xxxxxxxxx"

 


@robin2 wrote:

Hi,

 

I am trying to import data from a Microsoft Access data table that has a table name longer than 32 characters.

 

proc import out = work
datatable = "verylongtablenameherexxxx xxxxxxxxx"
dbms = access replace;
dbpwd = "xxxx";
database = "pathway to mdb";
run;

I get the following error message: ERROR: TABLE value exceeds maximum length of 32 characters.

Is there a way to get around this? I tried using the SQL pass through (which I have never used before) but that also presents an error.

 

proc sql;
connect to access(path="pathway to .mdb"
	dbpwd = "xxxx");
create table work.test as
select * from connection to access
(select * from "verylongtablenameherexxxx xxxxxxxxx");
disconnect from access;
quit;

ERROR: Prepare: Syntax error in query. Incomplete query clause.
SQL statement: select * from "Live Booster Phone calls Information"

Any ideas would be greatly appreciated.

 

Thank you,

Robin


 

robin2
Calcite | Level 5

Hi Reeza,

 

Thanks for the speedy reply. You were right - I needed to put the table name in square brackets. Now the pass through works!

 

Thanks so much,

Robin

 

proc sql;
connect to access(path="pathway to .mdb"
	dbpwd = "xxxx");
create table work.test as
select * from connection to access
(select * from [verylongtablenameherexxxx xxxxxxxxx]);
disconnect from access;
quit;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1869 views
  • 4 likes
  • 2 in conversation