RENAME-FILE

Renames an entire file or data section.

Note

Use MOVE-FILE to rename an account.

Command class

TCL-I command.

Syntax

The syntax used depends on what is being renamed.  For example:

Syntax elements

file-name1 The current name of the file you want to rename.

file-name2 The new name you want to give to the dictionary and default data section.

data-section-name1 The current name of the data section you want to rename.

data-section-name2 The new name you want to give to the data section.

A dictionary cannot be renamed without the data section, that is, you cannot specify DICT file-name.

Restrictions

RENAME-FILE cannot rename files larger than 2 GB in a filestore database; a partition database should be used instead.

Comments

If you are renaming a non-default data section, you need to specify both the dictionary name (file-name1) and the data section name (data-section-name1) in the RENAME-FILE command. Do not specify both names at the TO: prompt. Only specify the new data section name (data-section-name2).

Example 1

:RENAME-FILE OLDFILE
TO:NEWFILE

The software responds:

The file that formerly resided in the "CURRENT" account
and was called "OLDFILE"
now resides in the "CURRENT" account
and is called "NEWFILE"

The file definition item in the MD for OLDFILE had the item-id changed to NEWFILE.  Also, the data level descriptor OLDFILE in the DICT (if there is one) had the item-id changed to NEWFILE.

Example 2

:RENAME-FILE OLDFILE,SECTION.1
TO:SECTION.A

The software responds:

The data section that formerly resided in the "CURRENT" account
as a data section of the "OLDFILE" file
and was called "SECTION.1"
now resides in the "CURRENT" account as a
data section of the "OLDFILE" file and is called "SECTION.A"

The item-id of the data level descriptor SECTION.1 in the dictionary OLDFILE has been changed to SECTION.A.