I have this code and thou it changes the column code it does not change the label code. I can right click the table and change things but want to do it using SAS code
data table (drop = mem no yes rename=(tin = who));
set counts2;
array _col(2) no yes;
do _n_=1 to 2;
admission = vname (_col(_n_));
count = _col(_n_);
output;
end;
run;
So the tin is changed to who as the column but I want the label changed too
Since you are renaming the variable on the way out you need to use the old name of the variable in your Label statement.
What do you want to change it to? And what does this have to do with proc sql?
I just typed the stuff in wrong for the header. I want the label and column to be who
I need to do it in the above data step. Boss does not want the whole right click and manually changed. everything has to be code.
How about just assigning a null label. e.g.:
data want;
set sashelp.class (rename=(sex=who));
label who=;
run;
what is sashelp.class? I tried the above but used my table instead of the sashelp item and it still will not change the label name of TIN to WHO.
Since you are renaming the variable on the way out you need to use the old name of the variable in your Label statement.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.