Changes the name of a variable.
Valid in: | DATA step and PROC steps |
Category: | Variable Control |
is the variable that you want to rename.
is the new name of the variable. It must be a valid SAS name.
data one; input x y z; datalines; 24 595 439 243 343 034 ; proc print data=one; run; data two(rename=(x=keys)); set one; z=x+y; run; proc print data=two; run;
data three; set one(rename=(x=keys)); z=keys+y; run; proc print data=three; run;
Score1
to a variable named Score2
for
the PRINT procedure. Because the new name is applied before the data
is processed, the new name must be specified in the WHERE statement.
data test; input score1; datalines; 26 76 86 56 ; proc print data=test (rename=(score1=score2)); where score2 gt 75; run;