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.
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 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.
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 🙂
@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.
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!
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.