BookmarkSubscribeRSS Feed
CurlerBob
Fluorite | Level 6
I'm getting the following error while trying access a SQL table trough an ODBC connection:

Name 'THISSQLTABLEISREALLYLONGOVER32CHAR' is too long for a SAS name in this context.

SAS only allows table names to be 32 characters but this one is longer then that. What can I do to be able to access the table? And no, I can't change the table name or run a query to duplicate the data to a table with a shorter name.
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
I believe if you consult the SAS/ACCESS documentation
http://support.sas.com/documentation/cdl/en/acreldb/63283/HTML/default/viewer.htm#/documentation/cdl...

you will find how to use NAME LITERALS in order to specify DBMS long table names.

cynthia
CurlerBob
Fluorite | Level 6
I read the documentation and put the ' at the front and end of the table name with an n at the end. The same error message is generated. The documentation references uses that for unacceptable characters but not for length. Under the length section there is no reference on how to use longer names.
Cynthia_sas
SAS Super FREQ
Ah, well.... worth a try.

If you are using the SAS Add-in for Microsoft Office, this note talks about a hot fix:
http://support.sas.com/kb/36/127.html (probably not appropriate for just BASE SAS, though)

You may need to open a track with Tech Support to resolve this. If you are using ODBC, the problem may be with the SAS/Access ODBC driver. It would be interesting to find out whether the same issue occurs with the SAS/Access product specifically designed for the database in question.

To send a question to Tech Support, go to http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem". Alternately, you can go directly to the Tech Support Problem Form here:
http://support.sas.com/ctx/supportform/createForm

cynthia
BobJ
Calcite | Level 5
Hello,

Please pardon my post to an old topic, but this issue has been an on-going struggle for our company for most of the past year.

We use SAS Enterprise Business Intelligence (EBI) on Linux for X64 (SuSE 10) and connect to our operational data stored on a PostgreSQL 8.4 replication server, also on 64-bit Linux (SuSE 10), through the SAS/ACCESS Interface to ODBC.

Our database architect likes to make the table names descriptive. Since Base SAS 9.2 has a limit of 32 characters for table and view names, I and my predecessor have had to work-around this limit by manually creating views on our replication server to shorten the table names.

A current project instantiated 100+ views, many with names longer than 32 characters. A new requirement for this project involves surfacing many of these tables directly to our analysts.

I am working with the database architect to find a simple solution which does NOT involve renaming 50 or more views to fit this name length constraint. Unfortunately, it looks like we may have no choice in the next few weeks.

How can I, CurlerBob, and others best voice our need for SAS 9.x to support longer SQL names for tables, views, et cetera??

Thanks in advance for any insights you all can share!

Cheers,
BobJ
SASKiwi
PROC Star
I suggest you raise this as a Tech Support issue and ask them to escalate this suggestion back to the developers. If enough people do this then it will make the official SASWARE ballot. I have been using SAS long enough to remember when SAS names and tables were expanded from 8 to 32 characters long. User demand was a key driver for this.

In the meantime a quick fix might be to create a SAS dataset list of the longer than 32 character database tables, with a corresponding 32 character SAS name and then create a SAS macro to automatically generate valid SAS SQL views of the database tables from the SAS dataset list.
JariJuho
Calcite | Level 5

Use only the first 32 characters...

 

change

Select THISSQLTABLEISREALLYLONGOVER32CHAR from.... 

to

Select THISSQLTABLEISREALLYLONGOVER32CH from... 

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 11242 views
  • 0 likes
  • 5 in conversation