Previous Page | Next Page

The ACCESS Procedure for PC Files

RENAME Statement


Modifies the SAS variable name.
Valid: for DBF, DIF, WK1, WK3, WK4, Excel 4, Excel 5, and Excel 95 file formats under Windows operating environments
Applies to: access descriptor or view descriptor
Interacts with: ASSIGN, RESET

RENAME <'column-identifier-1'>=<'SAS variable-name-1'>...<'column-identifier-n'>=<'SAS variable-name-n'> ;


Details

The RENAME statement enters or modifies the SAS variable name that is associated with a column in a PC file. Use the RENAME statement when creating an access descriptor or a view descriptor.

An editing statement, such as RENAME, must follow the CREATE statement and the database-description statements when you create a descriptor. See CREATE Statement for more information about the order of statements.

Two factors affect the use of the RENAME statement: whether you specify the ASSIGN statement when you are creating an access descriptor, and the type of descriptor that you are creating.

The column-identifier argument can be either the column name or the positional equivalent from the LIST statement. This is the number that represents the column's place in the descriptor. To rename the SAS variable names that are associated with the seventh column and the nine-character FIRSTNAME column in a descriptor, submit this statement:

RENAME 7 birthdy 'firstname'=fname;

The column name, or positional equivalent is specified on the left side of the expression, with the SAS variable name on the right side. The equal sign (=) is optional. If the column name contains lowercase characters, special characters, or national characters, enclose the name in quotation marks. You can rename as many columns as you want in one RENAME statement.

When you are creating a view descriptor, the RENAME statement automatically selects the renamed column for the view. If you rename the SAS variable associated with a column, you do not have to issue a SELECT statement for that column.

When creating an access descriptor, the RENAME statement also re-selects previously dropped columns that were dropped with the DROP statement.

Previous Page | Next Page | Top of Page