Hi, i have one column named 9-24 . Is there a way to use is in a "keep" statement? I'm new to SAS and all the ways I tried failed as it's considered a range from 9 to 24.
Wrap each variable you want to keep in a single quote followed by an n.
View solution in original post
Are you trying to import variable from other source into SAS? Can you please show log?
Just merging 2 datasets.
So variable name is 9-24 and this is in SAS dataset?
What is the error message? Variable name does not conform to SAS naming conventions.
ERROR 214-322: Variable name 19 is not valid
It was imported from excell.
"9-24" is the label of the imported variable. It is not a valid SAS variable name, so it was replaced with "__24" (two underscores). You can use (keep=__24).
If you can change variable name in excel then do that. SAS variable name must begin with a letter (A-Z, either uppercase or lowercase) or an underscore (_).
Didn't work. I'm using" options validvarname=any" if that helps
ERROR: Not all variables from the list '9'n-'24'n have been found
Try double dash instead of single dash. If that doesn't work, please post the results from proc contents on your dataset.
proc contents data=have; run;
Need further help from the community? Please
ask a new question.