Rename Object (RNM)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

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 information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Restrictions:

  1. This command works on only one object. If a pattern is specified on the Object (OBJ) parameter and more than one object matches the pattern, the user can select the object from a list in an interactive job. If this is a batch job, the command fails with error message CPFA08E, "More than one name matches pattern.".

  2. When renaming an object in the "root" (/), QOpenSys or user-defined file systems, the user must have object management (*OBJMGT) authority to the object to be renamed, and write, execute (*WX) authority to the directory that contains the object. If the object to be renamed is a directory, the user must also have write (*W) authority to the directory.

  3. The user must have execute (*X) authority to each directory in the path.

  4. A user cannot rename an object within a "root" (/), QOpenSys, or user-defined file system directory that has the "restricted rename and unlink" attribute set on (this attribute is equivalent to the S_ISVTX mode bit) unless one or more of the following are true:

    1. The user is the owner of the object.

    2. The user is the owner of the directory.

    3. The user has all object (*ALLOBJ) special authority.

  5. The authority requirements and restrictions from the existing Rename Object (RNMOBJ) command and Rename Document Library Object (RNMDLO) command apply to objects in the QSYS.LIB, independent ASP QSYS.LIB, and QDLS file systems.

  6. In the QSYS.LIB and independent ASP QSYS.LIB file systems, the new name must contain the same object type suffix.

  7. Some objects cannot be renamed. An error is returned if an attempt is made to rename these objects.

  8. The file cannot be renamed if the file is a DataLink column in an SQL table and where a row in that SQL table references this file.

Top


 

Parameters

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

Top

 

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 concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

Top

 

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.

Top


 

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.

Top


 

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.

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.

Top