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.
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 25. 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.