Rename Object (RNM)

The Rename Object (RNM) command changes the name of an object in a directory.

This command can also be issued using the following alternative command name:

For more information about integrated file system commands, see the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Restrictions:

Parameters

Keyword Description Choices Notes
OBJ Object Path name Required, Positional 1
NEWOBJ New object Character value Required, Positional 2

Object (OBJ)

Specifies the path name of the object to be renamed.

For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

New object (NEWOBJ)

Specifies the new name of the object to be renamed. This name cannot contain any directory qualifiers and is in the same directory containing the existing object.

For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.

Examples

Example 1: Renaming an Object Link

RNM   OBJ('DECEMBER-1994-MONTHLY-PAYROLL-FILE')
      NEWOBJ('JANUARY-1995-MONTHLY-PAYROLL-FILE')

This command renames a file named DECEMBER-1994-MONTHLY-PAYROLL-FILE to a file named JANUARY-1995-MONTHLY-PAYROLL-FILE.

Error messages

*ESCAPE Messages

CPFA085
Home directory not found for user &1.
CPFA08E
More than one name matches pattern.
CPFA093
Name matching pattern not found.
CPFA09C
Not authorized to object. Object is &1.
CPFA09D
Error occurred in program &1.
CPFA09E
Object in use. Object is &1.
CPFA0A1
An input or output error occurred.
CPFA0A3
Path name resolution causes looping.
CPFA0A6
Number of links exceeds maximum allowed for the file system.
CPFA0A7
Path name too long.
CPFA0A9
Object not found. Object is &1.
CPFA0AA
Error occurred while attempting to obtain space.
CPFA0AB
Operation failed for object. Object is &1.
CPFA0B1
Requested operation not allowed. Access problem.
CPFA0B2
No objects satisfy request.
CPFA0B4
NEWOBJ parameter cannot start with a slash.
CPFA0B5
The NEWOBJ parameter cannot contain path.
CPFA0C4
Object not a file. Object is &1.