BookmarkSubscribeRSS Feed
MarkWik
Quartz | Level 8

Hi, I have DB2 Database table with table definitions stating column names are over 32 characters in length. I understand dataset names or variable names cannot be more than 32 in SAS. However is there a work around? Labelling is one option, but that does not form a part of the data structure as I read a SAS dataset and populate into database table. Can anybody help?

4 REPLIES 4
Kurt_Bremser
Super User

No, you can not have dataset names longer than 32 bytes, even in 9.4:

SAS(R) 9.4 Language Reference: Concepts, Fourth Edition

So your only option is to set up consistent rules for converting overlong table names when importing into SAS.

A similar "rule" is in place here for column names. DB/2 columns that have a "#" at the end of their name have that converted to an underline in SAS

MarkWik
Quartz | Level 8

Thanks Kurt, Does that apply to variable names as well? or validvarname= any options may help?

Kurt_Bremser
Super User

validvarname=any just allows use of name literals ('xxyy zz#$'n), but does not extend the length. This is probably rooted in the inner structure of the dataset header page.

SASKiwi
PROC Star

This issue comes up a lot. Even if SAS sticks with 32 character names for SAS datasets but enables reading of tables from other databases with longer names using other than SQL PASSTHRU would be an improvement.

Vote for this idea to encourage better solutions: https://communities.sas.com/ideas/3506

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
  • 4 replies
  • 13653 views
  • 0 likes
  • 3 in conversation