CHGOBJOWN (Change Object Owner)

CHGOBJOWN Command syntax diagram

 

Purpose

The Change Object Owner (CHGOBJOWN) command transfers object ownership from one user to another. The authority that other users have to the object does not change.

The owner of an object always has all the authorities applicable to the object unless they are explicitly revoked. The owner of an object has the authority to grant any authorities to any user for that object. Owners can also grant to themselves authorities that were previously revoked. Owners may, for example, remove some of their specific authorities as a precautionary measure, and then, when the need arises, grant those same authorities to themselves again.

The user with *ALLOBJ special authority has complete authority for all objects and can transfer the ownership of any object. All users have add and delete authorities for their own user profiles; that is, users can add objects to or delete objects (that they created) from their own user profiles by transferring the ownership of the object.

 

Restrictions

  1. To transfer ownership, have all of the following:

    • Object existence authority for the object
    • Object operational and object existence authorities if the object is a file, library, or subsystem description
    • *ALLOBJ special authority or ownership if the object is an authorization list
    • Add authority for the new owner's user profile
    • Delete authority for the present owner's user profile

  2. For display stations, if this command is not entered at the device whose ownership is being changed or whose message queue's ownership is being changed, this command should be preceded by the Allocate Object (ALCOBJ) command and followed by the Deallocate Object (DLCOBJ) command.
  3. Object type *DOC or *FLR cannot be specified; the user must use DLO (document interchange) support.
  4. Changing the ownership of an object that has an authority holder associated with it also changes the ownership of the authority holder.
  5. You must have *ALLOBJ and *SECADM special authorities to change the object owner of a program or an SQL (Structured Query Language) package that adopts authority.
  6. You must have *USE authority to the auxiliary storage pool device if one is specified.>

 

Required Parameters

OBJ
Specifies the qualified name of the object that is being assigned to the new owner. The library name can be entered to ensure that the correct object changes ownership.

The name of the object can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

object-name: Specify the name of the object that is assigned.

OBJTYPE
Specifies the object type, such as program (*PGM), file (*FILE), or library (*LIB) of the object whose ownership is being transferred. More information is in Commonly used parameters.

NEWOWN
Specifies the name of the user to whom the object is being assigned. The user profile must already exist.

 

Optional Parameters

CUROWNAUT
Specifies whether the current owner's authority is revoked when ownership is transferred to the new owner specified in the NEWOWN parameter.

*REVOKE: The current owner's authority is revoked when the object is transferred to the new owner.

*SAME: The value does not change.

ASPDEV
Specifies the auxiliary storage pool (ASP) device name where the library that contains the object (OBJ parameter) is located. If the object's library resides in an ASP that is not part of the library name space associated with the job, this parameter must be specified to ensure the correct object is used as the target of the change ownership operation.

*: The ASPs that are currently part of the job's library name space will be searched to locate the object. This includes the system ASP (ASP number 1), all defined basic user ASPs (ASP numbers 2-32), and, if the job has an ASP group, all independent ASPs in the ASP group.

*SYSBAS: The system ASP and all basic user ASPs will be searched to locate the object. No independent ASPs will be searched, even if the job has an ASP group.

auxiliary-storage-pool-device-name: The device name of the independent ASP to be searched to locate the object. The independent ASP must have been activated (by varying on the ASP device) and have a status of 'Available'. The system ASP and basic user ASPs will not be searched.>

Example for CHGOBJOWN

CHGOBJOWN  OBJ(USERLIB/PROGRAM1)  OBJTYPE(*PGM)
  NEWOWN(ANN)

This command assigns ownership of the program named PROGRAM1, located in the user library named USERLIB, to the user named ANN. The authority is revoked from the current owner.

Error messages for CHGOBJOWN

*ESCAPE Messages

CPF0609
Not allowed to use specified user profile.
CPF22BD
Ownership may not have been changed for object &1 in &3 type *&2.
CPF22BE
Function not done for user profile &1.
CPF22DA
Operation on file &1 in &2 not allowed.
CPF220A
New owner &1 does not have a uid.
CPF220C
Owner and primary group cannot be the same.
CPF2204
User profile &1 not found.
CPF2207
Not authorized to use object &1 in library &3 type *&2.
CPF2208
Object &1 in library &3 type *&2 not found.
CPF2209
Library &1 not found.
CPF2210
Operation not allowed for object type *&1.
CPF2211
Not able to allocate object &1 in &3 type *&2.
CPF2213
Not able to allocate user profile &1.
CPF2216
Not authorized to use library &1.
CPF2217
Not authorized to user profile &1.
CPF2222
Storage limit is greater than specified for user profile &1.
CPF2226
Function not done for user profile &1.
CPF2230
Not authorized to object &1 in library &3.
CPF2231
Not authorized to change ownership for program &1.
CPF2232
Not authorized to user profile &1.
CPF2233
No delete authority to user profile &1.
CPF2298
Authority not revoked for object &2 in &3 from user &1.
CPF320B
Operation was not valid for database file &1.
CPF324F
File &1 in library &2 does not exist.
CPF326A
Operation not successful for file &1 in library &2.
CPF327F
Operation not successful for file &1 in library &2.
CPF980B
Object &1 in library &2 not available.
CPF9814
Device &1 not found.
CPF9825
Not authorized to device &1.
CPF9873
ASP status is preventing access to object.>