Help using Base SAS procedures

proc sql label change

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 238
Accepted Solution

proc sql label change

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


Accepted Solutions
Solution
‎03-19-2012 05:47 PM
Super User
Super User
Posts: 6,499

proc sql label change

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


All Replies
PROC Star
Posts: 7,363

proc sql label change

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

Regular Contributor
Regular Contributor
Posts: 238

proc sql label change

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.

PROC Star
Posts: 7,363

proc sql label change

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

data want;

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

  label who=;

run;

Regular Contributor
Regular Contributor
Posts: 238

proc sql label change

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.

Solution
‎03-19-2012 05:47 PM
Super User
Super User
Posts: 6,499

proc sql label change

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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