|
Chapter Contents |
Previous |
Next |
| RENAME |
| Valid: | in a DATA step |
| Category: | Information |
| Type: | Declarative |
| Syntax | |
| Arguments | |
| Details | |
| Comparisons | |
| Examples | |
| See Also |
Syntax |
| RENAME old-name-1=new-name-1 . . . <old-name-n=new-name-n>; |
| Details |
The RENAME statement allows you to change the names of one or more variables, variables in a list, or a combination of variables and variable lists. The new variable names are written to the output data set only. Use the old variable names in programming statements for the current DATA step. RENAME applies to all output data sets.
| Comparisons |
| Examples |
rename street=address;
rename time1=temp1 time2=temp2 time3=temp3;
rename name=Firstname
score1-score3=Newscore1-Newscore3;
rename Olddept=Newdept Oldaccount=Newaccount; if Oldaccount>5000; keep Olddept Oldaccount items volume;
data market(keep=newdept newaccnt items
volume);
rename olddept=newdept
oldaccnt=newaccnt;
set sales;
if oldaccnt>5000;
run;
data temp;
input (score1-score3) (2.,+1) name $;
rename name=Firstname
score1-score3=Newscore1-Newscore3;
datalines;
12 24 36 Lisa
22 44 66 Fran
;
| See Also |
| Data Set Option:
|
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.