RENAME Statement

Specifies new names for columns in output tables.

Category:Global

Syntax

RENAME old-name {= | AS} new-name [ ... old-name {= | AS} new-name ];

Required Arguments

old-name

specifies the name of a column as it appears in the input table, or in the current DS2 program for newly created columns.

new-name

specifies the name to use in the output table.

Details

The RENAME statement enables you to change the names of one or more columns. The new column names are written to the output table only. Use the old column names in programming statements for the current DS2 program. RENAME applies to all output tables. In addition to changing the name of a column, the RENAME statement also changes the label for the column.

Comparisons

  • The RENAME= table option enables you to specify the columns that you want to rename for each input or output table. Use it in input tables to rename columns before processing.
  • If you use the RENAME= table option in an output table, you must continue to use the old column names in programming statements for the current DS2 program. The RENAME= table option affects only that output table. The RENAME statement affects all output tables.
  • If you use both the RENAME statement and RENAME= output table option, the RENAME statement has precedence. If X is renamed to Y with a RENAME statement and X is renamed to Z with a RENAME= table option, the RENAME statement takes precedence and X is renamed to Y.
  • The RENAME= table option in the SET statement renames columns in the input table. You must use the new names in programming statements for the current DS2 program.

Example

The following examples illustrate the RENAME statement.

  • rename prod=ProductName;
  • rename street as Address cit as City st as State;
  • rename oldsalary=newsalary;

See Also

Last updated: September 2, 2026