Hello.
Jeg got a dataset with a variable containing the letter "ø" (a Danish letter) and probably due to this, an error appears every time I try to open/use the data including when I try to rename the variable name.
I been looking around and found something called "validvarname=any" but I'm not sure of how to use this option and whether this it the correct option.
Any help appreciated
I would definitely try that first. You can find its documentation at: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279245.htm
To use it, just specify the following before you run your code:
options validvarname=any;
I would definitely try that first. You can find its documentation at: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000279245.htm
To use it, just specify the following before you run your code:
options validvarname=any;
Just to followup on Art's reply.
If the character is in the data it should not be a problem - if it is in the data and it is giving you a problem then the following will not help - it is something else again.
Here is a silly example with ++ representing a Danish character which is not on my keyboard. My suggestion is to rename as soon as possible. Notice that the variable name with the special characters is quoted and followed immediately with a n.
option validvarname=any;
data withdanish;
'ab++c'n = 5;
run;
data coffeeonly;
set withdanish(rename=('ab++c'n=abc));
run;
Hi. Arthur Carpenter .
Using proc datasets - a little tool managing datasets will save lots of time ,especiallly for a large table.
proc datasets library=work nolist;
modify withdanish;
rename 'ab++c'n=abc;
quit;
Happy New Year To you.
Happy to see you again at this forum.
Ksharp
Good point Ksharp. If all you wanted to do was rename the variable, DATASETS would definately be a better way. As you also show, the main point is the syntax for naming a variable with non-standard characters.
I have been busy writing my next book (on advanced techniques) which will be out in the spring.
Hi. Arthur Carpenter.
What is the name of your new book?
I will take a look at it.
Best Regards!
Ksharp
Thanks everyone.
The option validvarname=any solved the problem, but next time when I have access to SAS again I'll try the renaming method.
Thanks again
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 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: