RENAME Subcommand (EXPORT command)

RENAME renames variables being written to the portable file. The renamed variables retain their original variable and value labels, missing-value flags, and print formats. The names of the variables are not changed in the active dataset.

  • To rename a variable, specify the name of the variable in the active dataset, an equals sign, and the new name.
  • A variable list can be specified on both sides of the equals sign. The number of variables on both sides must be the same, and the entire specification must be enclosed in parentheses.
  • The keyword TO can be used for both variable lists.
  • If you specify a renamed variable on a subsequent DROP or KEEP subcommand, the new variable name must be used.

Example

EXPORT OUTFILE=NEWSUM /DROP=DEPT TO DIVISION
  /RENAME=(NAME,WAGE=LNAME,SALARY).
  • RENAME renames NAME and WAGE to LNAME and SALARY.
  • LNAME and SALARY retain the variable and value labels, missing-value flags, and print formats assigned to NAME and WAGE.