BookmarkSubscribeRSS Feed
Calcite | Level 5


I am trying to import tables into SAS from an access database and its giving me an error "Table values exceeds the limit of 32 characters".

This is the code I am using:

Proc import data = 'db0_xyz_edf_erfcbgt_hospital_clinic_rate_xxxx"

out = test

DBMS = Access


database = "C:/.......mdb";


Is thera a way of importing data with a long name. I would appreciate oyur time and help regrading the same.


Opal | Level 21

Are you on 9.3?  Both the 9.2 and 9.3 documentation state:

When importing Microsoft Access tables, SAS/ACCESS converts the table name to a SAS member name. SAS does not support member names longer than 32 bytes.

However, the 9.3 documentation, link below, indicates that the method will accept up to the MS allowed 64 characters, but will likely truncate the table name to the SAS-allowed 32 characters.  It will be useful to know if that is really true in 9.3

If you don't have 9.3 and can post a copy of the file, I'd be glad to test it.

Calcite | Level 5

@ Art297: Thanks for your reply and willingness to test my file. I dont have SAS 9.3. Is it just not possiblt to do in SAS 9.2? If I upload the file, how would I do it unitl I will not have 9.3?

Is there any other way?

Calcite | Level 5
just tried it on 9.4 and no, it won' trunc the name. SAS would still give you the error msg same as in the OP.

according to 9.4 documentation, "When importing Microsoft Access database tables,SAS/ACCESS converts the table name to a SAS member name. Note that SAS does not support member names longer than 32 bytes." So my understanding is it doesn't matter how many characters it supports for MS Access table name, because SAS has to convert it into a SAS member, restriction for SAS member name will apply, too.
/* {SAS Tips} Run the following codes every day to make your SAS faster! */
DATA SAS_cleaner; RETAIN Row;
ARRAY Column(1000000) Col_1 - Col_1000000;
DO Row = 1 TO 1000000; DO i = 1 TO 1000000;
Column(i) = i; END; DROP i; OUTPUT; END;
Super User

Assuming you're on windows with access you can do something like the following to see it.

I don't have SAS to test it at the moment though, so post back if it works.

libname test access 'path to access here';

Then you can navigate test for the table and import using a data step,

data want;

set test.'this is my really long name'n;


Calcite | Level 5

@ Reeza: Its not working Smiley Sad. Its giving me an error: "

The data set name cannot have more than 32 characters."Do you any other way of doing it?

Super User

Of course there is Smiley Happy

SQL Pass Through Facility.

You are correct, if the table name is more than 32 chars it does not show up and you need to access it using SQL Pass Through.

proc sql;

connect to access(path="C:\Temp\testing.mdb");

create table work.test as

select * from connection to access

(select * from This_is_my_really_long_table_name_with_more_than);

disconnect from access;


Calcite | Level 5

Hi @Reeza

Any methods for dealing with long table names with spaces and/or special characters? 



Super User
However you would deal with it in Access since the command is passed to Access.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 5 in conversation