You are here: Commands > Rename

Rename

Use the Rename command to change the name of a field, table or object in the Analyzer Project.

This command can be issued only in command mode. For more information, see Using Commands.

You can quickly rename any of the items that make up an Analyzer Project (for example, a table or a procedure) by right-clicking on the name of the item in the Overview and choosing “Rename”.

To use the Rename command to rename any of the items that make up an Analyzer Project, you must specify the appropriate parameter (for example, PROCEDURE) in the command. See the second variation of the Rename command syntax below.

You cannot rename a field that is either included in the current View or is included in the definition of a computed field. You also cannot rename a table that is currently in use.

You can also rename fields using the Table Layout window. In the “Edit Fields/Expression” tab from Edit/Table Layout, simply right-click on the field and select “Rename”.

Prerequisites

Fields to be renamed should not be included in the current View or referenced by a computed field definition. Analyzer will prompt you is this is the case. Fields cannot be renamed using a name of an existing field.

Tables to be renamed cannot be open and the new name can not be the same as the existing table name.

Parameters

In addition to the command parameters described below, the Rename command has the following command parameters: To. For a description, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

Procedure, Format, Index, Report, Workspace

Specifies the type of the item to be renamed.

Data, Log, Text

Specifies the type of file to be renamed. Implies an appropriate file extension (for example, Data.fil, Log.log, Text.txt).

Field

Allows you to rename a field.

OK

Indicates that the renaming process can proceed without confirmation.

Command Mode Syntax

RENAME <FIELD> {old-field-name|old-variable-name} <AS|TO> new-name <OK>¿

RENAME <PROCEDURE|FORMAT|INDEX|REPORT|WORKSPACE> {old-project-item-name} <AS|TO> new-name <OK>¿

RENAME <DATA|FILE|LOG|TEXT|old-file-name> <AS|TO> new-name <OK>¿

Examples

Whenever possible, a field’s name should describe its contents. If a field is not named appropriately, you may want to use Rename to change the name.

In a sales transaction file, to rename an invoice number field ProdNo to Product, use Rename. Be sure “Commands” is selected in the Command Log drop-down list box and enter the following into the Command Log text box:

RENAME FIELD PRODNO AS PRODUCT OK

If the renamed field is referenced in an unopened View, you will be prompted the next time you open that View that the old field name has been renamed or deleted.

The new name Product field appears in place of the old ProdNo field.

To rename a procedure called June_Procedure to July_Procedure without prompting, on the command line in the Command Log enter:

RENAME PROCEDURE JUNE_PROCEDURE TO JULY_PROCEDURE OK