About tables names greater 32 bytes

Reply
Frequent Contributor
Posts: 77

About tables names greater 32 bytes

Hi,

We need to register a table whose name is longer than 32 bytes,

is there a way to do it????

Thanks,

Silvia

Respected Advisor
Posts: 3,156

Re: About tables names greater 32 bytes

Simply put, No. There is not much you can do within SAS. You can though, access those tables (I assume this happens with other relational database, such as Oracle, SQL server etc) using explicit pass-thru.

Good luck,

Haikuo

Frequent Contributor
Posts: 77

Re: About tables names greater 32 bytes

Thanks Haikuo!!

I'll try it!

Silvia

Super User
Super User
Posts: 7,720

Re: About tables names greater 32 bytes

The question is why?  32 characters is far and away enough for any dataset id, if you need further information put it in the dataset label.

E.g.

data internal_id (label="This is a really long bit of information which describes the dataset called internal_id");

You don't want:

data this_is_a_really_long_bit_of_information...;

As that's not easy to work with.

Frequent Contributor
Posts: 77

Re: About  tables names greater 32 bytes

Hi,

The point is that when I want to register the tables , in management console , The tables with long names are not shown,

Silvia

Super User
Posts: 19,170

Re: About  tables names greater 32 bytes

SAS doesnt support table names longer than 32 characters.

Its an antiquated rule that my fingers are thankful for but that I hate in many cases.

Frequent Contributor
Posts: 77

Re: About  tables names greater 32 bytes

:smileylaugh:

Super User
Posts: 9,875

Re: About  tables names greater 32 bytes

Did you try

libname + perserve_tablename='yes'

Super User
Posts: 5,388

Re: About  tables names greater 32 bytes

PRESERVE_TAB_NAMES handle special characters and name quoting, not the 32 char limitation.

Data never sleeps
Frequent Contributor
Posts: 77

Re: About  tables names greater 32 bytes

Conclusion: it seems the solution is creating  views.

thanks to all of you

Super User
Posts: 5,388

Re: About  tables names greater 32 bytes

In the mean time you could do one of the following:

  1. Have the DBA create views that comply with the 32 char restriction.
  2. Create your own SQL pass thru-views. This wil give you the option of setting a SAS ds label (with the full length name)

As a best practice you could use the original full lenght table name in the meta data name, or in the description.

Data never sleeps
Super User
Posts: 3,238

Re: About tables names greater 32 bytes

Several DBMSs support table names longer than 32 chars. If you create libraries of these in SAS they just won't display and your only option for reading them is SQL Passthru.

If you think it would be a good idea to support longer names then vote for this idea: https://communities.sas.com/ideas/3506

Ask a Question
Discussion stats
  • 11 replies
  • 393 views
  • 1 like
  • 7 in conversation