CHGPGP (Change Primary Group)

CHGPGP Command syntax diagram

 

Purpose

The Change Primary Group (CHGPGP) command changes the primary group from one user to another. The owner's and other user's private authorities to the object do not change.

For more information about integrated file system commands, see Integrated file system topic in the File systems and management category of the Information Center.

 

Restrictions

  1. To change the primary group of an object in the QSYS.LIB or independent ASP QSYS.LIB > file system, 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
    • Object management authority, and the authorities being revoked, for the object if revoking the authority for the old primary group
    • Object management authority for the object and the authorities being given if a value other than *PRIVATE is specified for the DTAAUT parameter


  2. The new primary group user cannot be the owner of the object.

 

Required Parameters

OBJ
Specifies the path name of the object that is having its primary group changed. See path names for more information on specifying path names.

NEWPGP
Specifies the name of the user who is to be the new primary group for the object. The user profile must already exist and have a group ID number (gid number) assigned to it.

primary-group: Specify the name of the user who is to be the new primary group.

*NONE: The object does not have a primary group.

 

Optional Parameters

DTAAUT
Specifies which of the data authorities the new primary group has to the object.

*OLDPGP: The new primary group has the authority that the old primary group had to the object.

*PRIVATE: The new primary group has the private authority that the user has to the object. If the user that is the new primary group does not have private authority to the object, the new primary group has no authority to the object.

*RWX: The new primary group has object operational and all of the data authorities to the object.

*RX: The new primary group has object operational and data read and execute authorities to the object.

*RW: The new primary group has object operational and data read, add, update, and delete authorities to the object.

*WX: The new primary group has object operational and data add, update, delete, and execute authorities to the object.

*R: The new primary group has object operational and data read authorities to the object.

*W: The new primary group has object operational and data add, update, and delete authorities to the object.

*X: The new primary group has object operational and data execute authorities to the object.

*EXCLUDE: The new primary group has exclude authority to the object.

*NONE: The new primary group does not have any of the data authorities to the object.

OBJAUT
Specifies which of the object authorities the new primary group has to the object.

*NONE: None of the other object authorities (existence, management, alter, or reference) are given to the new primary group. If *OLDPGP, *PRIVATE, or *EXCLUDE are specified for the DTAAUT parameter, this value must be specified.

*ALL: All of the other object authorities (existence, management, alter, and reference) are given to the new primary group.

You can specify a maximum of four of the following values:

*OBJEXIST: The new primary group has object existence authority to the object.

*OBJMGT: The new primary group has object management authority to the object.

*OBJALTER: The new primary group has object alter authority to the object.

*OBJREF: The new primary group has object reference authority to the object.

RVKOLDAUT
Specifies whether the authorities for the current primary group are revoked when the primary group is changed to the user specified on the NEWPGP parameter.

*YES: The authorities for the current primary group are revoked when the primary group is changed to the other user.

*NO: The authorities for the current primary group become a private authority when the primary group is changed to the other user.

SYMLNK
Specifies whether to change the primary group of the object or of the symbolic link to the object.

*NO: The primary group of the object, not the symbolic link to the object, is changed.

*YES: If the object whose primary group is changing is a symbolic link, the primary group for the symbolic link is changed instead of changing the primary group of the object that the symbolic link points to.

Example for CHGPGP

CHGPGP   OBJ('/QSYS.LIB/USERLIB.LIB/PROGRAM1.PGM')
  NEWPGP(ANN)

This command changes the primary group of the program named PROGRAM1, located in the user library named USERLIB, to the group named ANN. The new primary group will have the same authority as the old primary group. The old primary group's authority is revoked.

Error messages for CHGPGP

*ESCAPE Messages

CPDA080
User profile name too long.
CPE3101
A non-recoverable I/O error occurred.
CPE3408
The address used for an argument was not correct.
CPE3418
Possible APAR condition or hardware failure.
CPE3474
Unknown system state.
CPFA0AA
Error occurred while attempting to obtain space.
CPFA0AB
Object name not a directory.
CPFA0AD
Function not supported by file system.
CPFA0A1
An input or output error occurred.
CPFA0A2
Information passed to this operation was not valid.
CPFA0A3
Path name resolution causes looping.
CPFA0A4
Too many open files for process.
CPFA0A5
Too many open files.
CPFA0A7
Path name too long.
CPFA0A9
Object not found.
CPFA0B1
Requested operation not allowed. Access problem.
CPFA0C0
Buffer overflow occurred.
CPFA0C1
CCSID &1 not valid.
CPFA0CE
Error occurred with path name parameter specified.
CPFA0DD
Function was interrupted.
CPFA0D4
File system error occurred.
CPFA08B
Path name cannot begin with *.
CPFA08C
Pattern not allowed in path name directory.
CPFA085
Home directory not found for user &1.
CPFA086
Matching quote not found in path name.
CPFA087
Path name contains null character.
CPFA088
Path name pattern not valid.
CPFA09C
Not authorized to object.
CPFA09D
Error occurred in program &1.
CPFA09E
Object in use.
CPFA09F
Object damaged.
CPFA091
Pattern not allowed in user name.
CPFA092
Path name not converted.
CPFA093
Name matching pattern not found.
CPFA094
Path name not specified.
CPF1F05
Directory handle not valid.
CPF1F41
Severe error occurred while addressing parameter list.
CPF1F4A
Value for number of directory entries not valid.
CPF1F53
Value for length of data buffer not valid.
CPF220B
New primary group &1 does not have a gid.
CPF2203
User profile &1 not correct.
CPF2204
User profile &1 not found.
CPF2213
Not able to allocate user profile &1.
CPF2217
Not authorized to user profile &1.
CPF2225
Not able to allocate internal system object.
CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF223A
Not all objects changed.
CPF3BF6
Path Type value is not valid.