Hi ,
I have a sas dataset with some columns. I need to change the variable name of the dataset as that variable name is producing an error when i am trying to register the table in metadata. How can i rename the variable if i know only part of the variable name.
Regards,
Naveen
Do the following in a program window first:
data dataset;
set dataset;
rename 'test?_name'n = test_name;
run;
You should then be able to register the dataset.
It may be necessary to copy the variable name from the proc contents output and paste it into the string delimited by the single quotes, to avoid problems by different character representations.
What do you mean that you only know a part of the name?
What kind of error do you get during registration?
Please show the real life example/elaborate more about the situation.
ERROR: Character is unclassifiable.
I think this is because of column name. so only i was asking how to rename a column. On seaching column name using proc content i got name as
test?_name of type num and length 8.
Do the following in a program window first:
data dataset;
set dataset;
rename 'test?_name'n = test_name;
run;
You should then be able to register the dataset.
It may be necessary to copy the variable name from the proc contents output and paste it into the string delimited by the single quotes, to avoid problems by different character representations.
If this is a SAS dataset, you generally use PROC DATSETS to do this.
But you should be able to see the actual columns name if you issue a non-mete libname to the loaction of your SAS data files.
What is the setting of validvarname in the environment? And where did this data got created?
how to check the setting of validvarname. Sorry i have not changed any system settings in my environment. So i am not sure which autoexec file should i check
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.