tags:

views:

57

answers:

1

In SAS you can do.

data a(rename=(a=b) );
  a = 1;
run;

to rename a variable in the data step data statement (or data step header as I call it).

What's the syntax to change the label? I tried

data a(label=(a='a to b') );
  a = 1;
run;

But it doesn't work.

+1  A: 

data a; a=1; label a="label"; * original label; run;

proc datasets lib=work nolist; modify a; label a='new label'; run; quit;

Kevin Qin
Even though you can't do it in the data step header. The reason why I wanted to do it in the datastep header is to save a cycle of IO. The proc datasets methods seems to be able to achieve that.
xiaodai