Can I rename a variable in a SAS data set without input/output actions in data step, since I don't change the data stored in the set actually?
Yes, you could use proc sql instead:
proc sql; create table TEST as select
old_name as new name,
other_stuff,
more_other_stuff
from TEST;
quit;
Or proc datasets.
@SaraBoltman1 wrote:
Yes, you could use proc sql instead:
proc sql; create table TEST as select
old_name as new name,
other_stuff,
more_other_stuff
from TEST;
quit;
Doesn't this require the processing of every observation in the data step?
Or proc datasets.
I'm 100% sure this does not require processing of every observation in the data step. It doesn't even have to process one observation.
data have;
set sashelp.class;
run;
proc datasets library=work nolist nodetails;
modify have;
rename name=xxxxxx;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.