z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


getgrgid

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-getgrgid--gid--stem-----------------------------------------><

Function

getgrgid invokes the getgrgid callable service to get information about a group and its members; the group is identified by its group ID (GID).

Parameters

gid
A numeric value.
stem
The name of a stem variable used to return the information. Upon return, stem.0 contains the number of variables returned. To access the status values, you can specify a numeric value (see REXX predefined variables) or the predefined variable beginning with GR_ used to derive the appropriate numeric value. For example, you can specify stem.2 or stem.gr_gid to access the group ID:
Variable Description
GR_GID The group ID
GR_MEM The stem index of the first member name returned
GR_MEMBERS The number of members returned
GR_NAME The name of the group

Usage notes

A RETVAL greater than zero indicates success. A RETVAL of -1 or 0 indicates failure. A RETVAL of 0 has an ERRNOJR, but no ERRNO.

Example

In the following example, assume that gid was assigned a value earlier in the exec. To get a list of names connected with a group ID:
"getgrgid (gid) gr."
say 'Users connected to group number' gid ':'
do i=gr_mem to gr.0
   say gr.i
end

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014