BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6
I have to import one excel sheet in that sheet one column name is "monthly wise and year wise number'
When I am importing this sheet it is showing error like length is more than 32 characters .
So how to resolve that error
7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Use named literals:

http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000998953.htm

 

I.e. 

libname excel "....xlsx";

data want;
  set "monthly wise and year wise number"n;
run;

An make sure once you imported it to change its name to use SAS naming so you dont have to code that each time.

 

Or drop Excel as a datasource, which generally sorts a lot of issues.

thanikondharish
Fluorite | Level 6
I am asking variable name
RW9
Diamond | Level 26 RW9
Diamond | Level 26

This post makes no sense.  I have provided a link to the mechanism that SAS uses to access names which are not SAS compliant.  If you have further questions, please elaborate in full with examples so I don't need to guess what you mean.

thanikondharish
Fluorite | Level 6
Sorry I got the data that is SAS teachnical issue
So I closed the SAS and again opened and run the program
Reeza
Super User

@thanikondharish wrote:
Sorry I got the data that is SAS teachnical issue
So I closed the SAS and again opened and run the program

Please mark this question as closed.

PeterClemmensen
Tourmaline | Level 20

If I were you, I would change the variable name directly in the Excel workbook. Get rid of spaces and keep it shorter and simpler 🙂

Kurt_Bremser
Super User

@thanikondharish wrote:

When I am importing this sheet it is showing error like length is more than 32 characters .


Use a shorter name in Excel, or use a sustainable data transfer process that does NOT rely on the Excel file format. Column names in SAS are hard limited to 32 characters, there's no way around it.

SAS 9.6 or 10 (or whatever the next major version will be called) might provide the capability for longer names, but at the moment the (in my opinion VERY reasonable) limit of 32 is in place.

 

For a reliable import process, use a proper file format like CSV or any character-delimited or fixed-width text file. In the data step, YOU define the names, and you do not have to work around the crazy ideas of lusers.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 7 replies
  • 1620 views
  • 0 likes
  • 5 in conversation