Command reference / ifs

CHGPGP

Change Primary Group

Changes the primary group of one or more IFS objects selected by path or pattern.

Allowed environments: *ALL. Positional parameters: 2.

Parameters

OBJ Object

Sets the object, or a pattern to match multiple objects, for which the primary group is to be changed.

Type
*CHAR
Required
Yes
Length
5000
Case
Mixed case
path-name
Enter the path name of the objects whose primary group is to be changed.

NEWPGP New primary group

Sets the user who is to be the new primary group for the object. The user profile must already exist when this command is run, and must have a group identifier (or gid ) assigned to it.

Type
*NAME
Required
Yes
Length
10
Case
Uppercase

Suggested / special values: *NONE

*NONE
The object does not have a primary group.
name
Enter the name of the user profile who is to be the new primary group for the object.

DTAAUT New data authorities

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

Type
*CHAR
Required
No
Default
*OLDPGP
Length
8
Case
Uppercase

Allowed values: *OLDPGP, *PRIVATE, *RWX, *RX, *RW, *WX, *R, *W, *X, *EXCLUDE, *NONE

*OLDPGP
The new primary group has whatever authority 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 New object authorities

Select which of the object authorities the new primary group has to the object.

Type
*CHAR
Required
No
Default
*NONE
Length
9
List limit
4
Case
Uppercase

Allowed values: *NONE, *ALL, *OBJEXIST, *OBJMGT, *OBJALTER, *OBJREF

*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.
*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 Revoke current authority

Controls whether the authorities for the current primary group are revoked when the primary group is changed to the user specified for the New primary group (NEWPGP) parameter.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*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.

SUBTREE Directory subtree

Choose whether to change the objects within the subtree if the object specified by the Object (OBJ) parameter is a directory or a library.

Type
*CHAR
Required
No
Default
*NONE
Length
5
Case
Uppercase

Allowed values: *NONE, *ALL

*NONE
The objects specified by the OBJ parameter are changed. If the object is a directory or a library, it will be changed, but the directory or library contents will not be changed.
*ALL
The objects specified by the OBJ parameter are changed. If the object is a directory or a library, it will be changed as well as the contents of the directory or library and the contents of all subdirectories.

SYMLNK Symbolic link

If the object is a symbolic link, specifies whether or not to change the symbolic link or the object pointed to by the symbolic link.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Keep the current symbolic link object. The object pointed to by the symbolic link is changed.
*YES
If the object is a symbolic link, the symbolic link is changed. The object pointed to by the symbolic link is not changed.

Examples

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

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.

CHGPGP OBJ('/sym1') NEWPGP(SAM) SUBTREE(*ALL) SYMLNK(*NO)

Will first determine if there are subtrees to process.

CHGPGP OBJ('/sym1') NEWPGP(JOE) SUBTREE(*ALL) SYMLNK(*YES)

Will first determine if there are subtrees to process.

CHGPGP OBJ('/dir1') NEWPGP(PETE) SUBTREE(*ALL) SYMLNK(*NO)

Will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a directory, the subtrees will be processed.

CHGPGP OBJ('/dir1') NEWPGP(GEORGE) SUBTREE(*ALL) SYMLNK(*YES)

Will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a directory, the subtrees will be processed.

CHGPGP OBJ('/dir1') NEWPGP(BETTY) SUBTREE(*NONE) SYMLNK(*NO)

Will not process subtrees. Since the object specified in the OBJ parameter is not a symbolic link, the SYMLNK parameter will be ignored. The primary group of dir1 is changed to BETTY.

IBM command documentation

Generated from os/cl/catalog/CHGPGP.json and os/cl/help/CHGPGP.json.