UDM - IBM i rename (Rename) Command

IBM i rename (Rename) Command

The rename (Rename) command in the UDM for IBM i LIB file system takes the following form:

RENAME logical-name old-name new-name

rename Command Requirements

The rename command has the following requirements:

  • Libraries cannot be renamed.
  • A single object level (file or member) can be renamed only with a single call. The name of a file and one of its members cannot be renamed with a single call. All other cases result in a failure.
  • Wild cards are not allowed.
  • It can be used only at the file and member level; it cannot be used to rename libraries, However, rename can be used to move existing files to existing libraries.
  • It cannot be used to move a member from one file to another, since the destination file may not have the same attributes (for example, record length) as the source file. This could result in corrupt (or seemingly corrupt) data.
  • It cannot be used to move a file from one library to another because it should not be used to create new libraries.

rename Command Forms


Name

Description

RENAME logical-name LIBRARY/FILE LIBRARY/FILE

Renames the file in the old portion with file name in the new portion. The library in the new name portion of the rename must match the library name in the old name portion.

RENAME logical-name FILE FILE

Renames the file in the current library in the old portion with the new file name in the current directory (library).

RENAME logical-name FILE LIBRARY/FILE

Renames the file in the current directory with the file name in the new portion. The library in the old name portion must be the current library.

RENAME logical-name LIBRARY/FILE FILE

Renames the file in the given library with the name of the file in the new portion, if the library name in the old portion is the same as the current library

RENAME logical-name LIBRARY/FILE(MEMBER) LIBRARY/FILE(MEMBER)

Renames the old member name with the new member name. Both the library and file name portions in the old and new member names must match

RENAME logical-name FILE(MEMBER) FILE(MEMBER)

Renames the member in the old name with the name of the member in the new name. The FILE portion of each name must be the same

RENAME logical-name FILE(MEMBER) LIBRARY/FILE(MEMBER)

Renames the member in the old name with the name of the member in the new name if the library specified in the old name is the same as the current library and both file name portions match

RENAME logical name LIBRARY/FILE(MEMBER) FILE(MEMBER)

Renames the member in the old name with the name of the member in the new name if the library specified in the new name is the same as the current library and both file name portions match