Rename Object (QLIRNMO) API


  Required Parameter Group:


  Optional Parameter Group 1:


  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes.

The Rename Object (QLIRNMO) API renames an existing object to a new object name or moves the object to a different library or both, and optionally replaces the existing target object. This API combines the functions of the Rename Object (RNMOBJ) and the Move Object (MOVOBJ) commands. The API allows you to rename and move in one step, and optionally replace the existing object in the target library.

When the replace object parameter requests to replace an existing object and the target object already exists, the following occur:


Restrictions

All restrictions that apply to the Move Object (MOVOBJ) and Rename Object (RNMOBJ) commands also apply to the QLIRNMO API.


Authorities and Locks

Auxiliary Storage Pool (ASP) Device Authority
*USE when a specific ASP device name is specified for optional parameter group 1.

Library Authority
*CHANGE

Note: If you are renaming an object that can only exist in library QSYS, the library authority is not checked.

Object Authority
*OBJMGT

Notes:

  1. Object types of *FILE, *JRN, *JRNRCV, and *MSGQ need *OBJOPR and *OBJMGT authorities.
  2. An object type of *AUTL needs *AUTLMGT authority.


Library Lock
*SHRUPD

Object Lock
*EXCL

If you replace an object, you must be the owner of the from object or have *ALLOBJ special authority. *ALLOBJ authority is needed to replace the authority on the from object.

When the request is to replace an existing object and the target object already exists, the following authority considerations apply:


Required Parameter Group

From qualified object name
INPUT; CHAR(20)

The object being renamed and the library in which it is located. The first 10 characters contain the object name, and the second 10 characters contain the library name.

You can use these special values for the library name:


Object type
INPUT; CHAR(10)

The type of object being renamed. If the from object and the target object belong to the same library, only a rename operation is done. The object type must be supported on the RNMOBJ command. If the from object and the target object belong to different libraries, a move operation is done. The object type must be supported on the MOVOBJ command. If both a rename and a move operation are done, the object type must be supported on both the RNMOBJ and MOVOBJ commands. An asterisk (*) must precede the object type. For a list of the object types that cannot be moved or renamed, see the Renaming objects and Moving objects from one library to another topics.

Target qualified object name
INPUT; CHAR(20)

The new name of the object and the new library in which it will be located. The object name can be the same name as the original object or a new name. The library name can be the same name as the original library or a new name. If the object name is the same as the original object, the library name must not be the same as the original library unless the target and from library auxiliary storage pool (ASP) device names are not the same. The first 10 characters contain the object name, and the second 10 characters contain the library name.

Replace object
INPUT; CHAR(1)

Whether to replace an existing object with the same name as the target object and library name parameter in the auxiliary storage pool named in the target library auxiliary storage pool (ASP) device name parameter. The following values can be specified:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Optional Parameter Group 1

From library auxiliary storage pool (ASP) device name
INPUT; CHAR(10)

The name of the auxiliary storage pool (ASP) device from which storage is allocated for the library containing the object to be renamed or moved. For all operations other than a library rename, the ASP device must have status of 'Available'. For a library rename operation, the ASP device must have a status of 'Active' or 'Available' and the target library auxiliary storage pool (ASP) device and the from library auxiliary storage pool (ASP) device must be the same device. If this parameter is omitted in cases where it is valid for this parameter to have a value other than an asterisk (*), the thread's library name space will be used.

This parameter must be an asterisk (*) if specified when *CURLIB or *LIBL is specified as the library name in the from qualified object name parameter. If a library to be renamed is in an auxiliary storage pool (ASP) device that is not currently part of the thread's library name space, specify current-library-name in the first 10 characters and QSYS in the second 10 characters of the from qualified object name and the auxiliary-storage-pool-device-name in the from library auxiliary storage pool (ASP) device name.

One of the following special values may be specified:


Target library auxiliary storage pool (ASP) device name
INPUT; CHAR(10)

The name of the auxiliary storage pool (ASP) device from which storage is allocated for the library to contain the object after the rename or move. For all operations other than a library rename, the ASP device must have status of 'Available'. For a library rename operation, the ASP device must have a status of 'Active' or 'Available' and the target library auxiliary storage pool (ASP) device and the from library auxiliary storage pool (ASP) device must be the same device. If this parameter is omitted, the thread's library name space will be used.

If a library to be renamed is to be in an auxiliary storage pool (ASP) device that is not currently part of the thread's library name space, specify new-library-name in the first 10 characters and QSYS in the second 10 characters of the target qualified object name and specify either *SAME or an auxiliary-storage-pool-device-name in the target library auxiliary storage pool (ASP) device name that is the same as specified in the from library auxiliary storage pool (ASP) device name.

One of the following special values may be specified:


Usage Notes

This API is conditionally threadsafe. For multithreaded jobs, see the restrictions in the Rename Object (RNMOBJ) command.


Error Messages



API introduced: V2R3

[ Back to top | Object APIs | APIs by category ]