DATASETS Procedure

RENAME Statement

Renames variables in the SAS data set specified in the MODIFY statement.
Restriction: Must appear in a MODIFY RUN group
Modifying SAS Data Sets

Syntax

Required Argument

old-name=new-name
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 Words and Names in the SAS Language 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.