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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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