BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5
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
Calcite | Level 5
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
Calcite | Level 5
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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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