BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Since you are renaming the variable on the way out you need to use the old name of the variable in your Label statement.

View solution in original post

5 REPLIES 5
art297
Opal | Level 21

What do you want to change it to?  And what does this have to do with proc sql?

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

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.

art297
Opal | Level 21

How about just assigning a null label.  e.g.:

data want;

  set sashelp.class (rename=(sex=who));

  label who=;

run;

tmm
Fluorite | Level 6 tmm
Fluorite | Level 6

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.

Tom
Super User Tom
Super User

Since you are renaming the variable on the way out you need to use the old name of the variable in your Label statement.

SAS Innovate 2025: Register Now

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!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3723 views
  • 3 likes
  • 3 in conversation