the variable has a space in it, I checked using proc contents and both the label and var name have a space in them. I tried renaming using the rename option
this is the error I get
For non-standard names, you have to use name literals:
rename 'education level'n = education_level;
You need
options validvarname=any;
and then you can rename with
rename 'education level'n = education_level;
notice the quotes and the letter n after the final quote
PS you can avoid this by issuing
options validvarname = v7;
before importing the data into SAS.
So if this is an excel file, this option should go before proc import?
Yes. SAS will then convert the names to valid SAS names by replacing invalid characters with underlines.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.