CL Command Reference - MOVOBJ
CL Command List > MOVOBJ Reference
Description:
The Move Object (MOVOBJ) command removes an object from its currently assigned library and places it in a different library. The save and restore information is removed from the object description.
Note: The value of the Create authority (CRTAUT) parameter specified on the Create Library (CRTLIB) command for the to-library is not used. The ownership and public and private authorities of the object remain the same.
When the object type of the object to be moved is an object type which can be journaled, the existence and content of a data area named QDFTJRN in the to-library will determine whether or not journaling is started for the object. With the exception noted below in the considerations for moving an object from QTEMP to a primary or secondary ASP, if the object was journaled in the from-library, it will continue to be journaled in the to-library.
Restrictions:
1. For an object other than a *FILE object, you must have:
. object management (*OBJMGT) authority for the object which is to be moved,
. delete (*DELETE) and read (*READ) authorities for the library from which the object is to be moved, and
. add (*ADD) and read (*READ) authorities for the library to which the object is to be moved.
2. For a *FILE object, you must have:
. object management (*OBJMGT) and object operational (*OBJOPR) authority for the object which is to be moved,
. delete (*DELETE), add (*ADD), and execute (*EXECUTE) authorities for the library from which the object is to be moved, and
. add (*ADD) and read (*READ) authorities for the library to which the object is to be moved.
3. The following object types cannot be moved: Libraries, user profiles, edit descriptions, line descriptions, controller descriptions, device descriptions, journals, and journal receivers.
4. The following objects cannot be moved: the system operator message queue QSYSOPR, all work station user message queues, and the system log QHST.
5. The library to which the object is to be moved must not already contain an object of the same name and type as the object to be moved.
6. The library to which the object is to be moved cannot be QTEMP.
7. The user space (*USRSPC), user index (*USRIDX), and user queue (*USRQ) user domain objects can only be moved into libraries that are permitted in the system value QALWUSRDMN (allow user domain objects in library). However, if the user object was created as a system domain object, it is not restricted.
8. As a general rule, objects cannot be moved to the to-library if the object and the to-library are in different auxiliary storage pools (ASPs). An error message is sent when the object cannot be moved. There are some specific exceptions to the general rule:
. You can move save files that are in a basic user ASP to libraries that are in the system ASP (ASP 1) if the save file*s library is also in the system ASP.
. You can move objects in a secondary ASP to the primary ASP in the same ASP group if the to-library is QRPLxxxxx (where *xxxxx* is the number of the primary ASP of the ASP group.)
. You can move an object from QTEMP to a primary or secondary ASP with the following considerations: 每 The *move* is accomplished through a save and restore operation.
每 The size of the object must be less than 1 terabyte. (The Move Library to ASP (QHSMMOVL) API does not have this size limitation.)
每 If the object cannot be renamed, it cannot be moved.
每 For data queues, message queues, and logical files, only the object descriptions are moved. The contents of the objects are not moved.
每 The private authorities for the objects will be preserved.
每 After the object has been moved, the following attributes will differ from the original object:
- The date last used will be set to blank.
- The change date and time will be set to the current date and time.
- The days used count will be set to zero.
- The date use count reset will be set to blank.
- The restore date and time will be set to the current date and time.
- When the object type of the object to be moved is an object type which can be journaled, the existence and content of a data area named QDFTJRN in the to-library will determine whether or not journaling is started for the object. If the QDFTJRN data area does not exist or does not indicate that journaling should be started for a restore operation for the object type, the object will not be journaled even if the original object was journaled.
Examples:
Example 1: Moving an Object from the General Purpose Library
MOVOBJ OBJ(QGPL/X) OBJTYPE(*PGM) TOLIB(MY)
The general purpose library (QGPL) is searched for the X program (*PGM) object. The X program object is moved to the MY library. After this command is run, the X program object is no longer in the QGPL library.
Example 2: Moving an Object from a Library in the Library List
MOVOBJ OBJ(*LIBL/Y) OBJTYPE(*FILE) TOLIB(Z)
-or-
MOVOBJ Y *FILE Z
The library list (*LIBL) is searched for the Y file object. If more than one file object with the same name exists in the libraries making up the library list, the first Y file object found in the library list is moved to the Z library. After this command is run, the Y file object is no longer in the library where it was found.
Example 3: Moving an Object from a Library in an Independent Auxiliary Storage Pool (ASP) to a Library in a different ASP.
MOVOBJ OBJ(INVENTORY/MONTHLY) OBJTYPE(*PGM)
TOLIB(WINVENTORY) ASPDEV(SALES) TOASPDEV(WSALES)
The INVENTORY library in the SALES independent auxiliary storage pool (ASP) is searched for the MONTHLY program object. The MONTHLY program object is moved to the WINVENTORY library in the WSALES ASP. After this command is run, the MONTHLY program object is no longer in the INVENTORY library in the SALES ASP. The SALES ASP and the WSALES ASP must have been activated (by varying on the ASP device) and have a status of *Available*.