Rename objects

You can use the Rename Object (RNMOBJ) command to rename objects.

However, you can rename an object only if you have object management authority for the object and update and execute authority for the library containing the object.

To rename an authorization list, you must have authorization list management authority, and both update and read authority for library QSYS.

The following objects cannot be renamed:

Also, you cannot rename an output queue unless it is empty. You should not rename IBM-supplied commands because the licensed programs also use IBM-supplied commands.

To rename an object, you must specify the current name of the object, the name to which the object is to be renamed, and the object type.

The following RNMOBJ command renames the object ORDERL to ORDFILL:

RNMOBJ   OBJ(QGPL/ORDERL)  OBJTYPE(*FILE)   NEWOBJ(ORDFILL)

You cannot specify a qualified name for the new object name because the object remains in the same library. If the object you want to rename is in use when you issue the Rename Object (RNMOBJ) command, the command runs, but does not rename the object. As a result, the system sends you a message.

When you rename objects, you should be careful not to rename objects that other objects depend on. For example, CL programs depend on the command definitions of the commands used in the program to be named the same at run time as they were at compile time. Therefore, if the command definition is renamed in between these two times, the program cannot be run because the commands will not be found. Similarly, any application program you write depends on certain objects being named the same at both times.

You cannot rename a library that contains a journal, journal receiver, data dictionary, cluster resource group, or SQL package.

An object referring to another object may be dependent on the object and library names (even though *LIBL can be specified for the library name). Therefore, if you rename an object, you should change any references to it in other objects.

If you rename a physical or logical file, the members in the file are not renamed. However, you can use the Rename Member (RNMM) command to rename a physical or logical file member.

Note: You should be careful when renaming objects in the system library QSYS. These objects are necessary for the system to perform effectively and the system must be able to find the objects. This is also true for some of the objects in the general-purpose library QGPL.
Related reference
Move objects from one library to another
Related information
Rename Object (RNMOBJ) command