Hi,
How can I select column name with _ and space like name _category.
Is there any way in SAS that can standardize the column name ?
@jeremy7 wrote:
Hi,
How can I select column name with _ and space like name _category.
Is there any way in SAS that can standardize the column name ?
To reference a name that does not follow normal rules you have to use a name literal
'name _category'n
What is the SOURCE of the data that has names with spaces in them?
To allow SAS to use such names you have to have set the VALIDVARNAME option to ANY.
If the source was an Excel file or text file that you imported you could set the VALIDVARNAME back to V7 and then re-import the data. PROC IMPORT should then convert those invalid names to something usable. Perhaps name__category.
Add this to the top of your code and re-run it.
options validvarname=v7;
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.