Command reference / ifs
RNM
Rename Object
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: REN 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/.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- 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.".
- 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 and 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.
- The user must have execute (*X) authority to each directory in the path.
- 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:
- The user is the owner of the object.
- The user is the owner of the directory.
- The user has all object (*ALLOBJ) special authority.
- 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.
- In the QSYS.LIB and independent ASP QSYS.LIB file systems, the new name must contain the same object type suffix.
- Some objects cannot be renamed. An error is returned if an attempt is made to rename these objects.
- 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.
Parameters
OBJ
Object
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.
NEWOBJ
New object
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
RNM OBJ('DECEMBER-1994-MONTHLY-PAYROLL-FILE') NEWOBJ('JANUARY-1995-MONTHLY-PAYROLL-FILE')
Renaming an Object Link. This command renames a file named DECEMBER-1994-MONTHLY-PAYROLL-FILE to a file named JANUARY-1995-MONTHLY-PAYROLL-FILE.
Generated from os/cl/catalog/RNM.json and os/cl/help/RNM.json.