The DATASETS Procedure |
Restriction: | Must appear in a MODIFY RUN group |
Featured in: | Modifying SAS Data Sets |
RENAME old-name-1=new-name-1
<...old-name-n=new-name-n>; |
Required Arguments |
changes the name of a variable in the data set specified in the MODIFY statement. old-name must be a variable that already exists in the data set. new-name cannot be the name of a variable that already exists in the data set or the name of an index, and the new name must be a valid SAS name. See "Rules for SAS Variable Names" in SAS Language Reference: Concepts.
Details |
If old-name does not exist in the SAS data set or new-name already exists, PROC DATASETS stops processing the RUN group containing the RENAME statement and issues an error message.
When you use the RENAME statement to change the name of a variable for which there is a simple index, the statement also renames the index.
If the variable that you are renaming is used in a composite index, the composite index automatically references the new variable name. However, if you attempt to rename a variable to a name that has already been used for a composite index, you receive an error message.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.