Hi all,
I have 3 var,
VAR1 VAR2 VAR3 in dataset name A
want to change VAR1=FILEID VAR2=SUTSAB VAR3=ID by keeping dataset name same, A..
what code should look like?
Thanks...
is this is correct - i don't have SAS with me so just want to make sure
data a;
set work.a;
rename var1=fileid var2=stusab var3=id;
run;
Thanks
Yes, it is correct.
yes, this is correct!
Yes, but you're basically deleting your old copy and creating a new copy.
If you have a large dataset you may want to use proc datasets to rename the variables in the dataset.
proc datasets library=work;
modify a;
rename VAR1=FILEID VAR2=SUTSAB VAR3=ID;
quit;
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.