0
votes

In SAS proc sql, how do I preserve the label of myvar (in myoldtable) when performing the following simple operation?:

proc sql; create table mytable as select myvar*1.5 as myvar from myoldtable; quit;

1

1 Answers

1
votes

Would it be possible to just update myoldtable instead? That will do the math and preserve your variable name...

proc sql;
    update myoldtable
    set myvar=myvar*1.5;
quit;

Of course, if you're really stuck on getting the new table, you could always do this:

proc sql;
    create table mynewtable as
    select * from myoldtable;

    update myoldtable
    set myvar=myvar*1.5;
quit;