>>-getgrnam--name--stem----------------------------------------><
Function
getgrnam invokes the getgrnam callable service to get
information about a group and its members. The group is identified
by its name.
Parameters
- name
- A string that specifies the group name as defined to the system.
- 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.
- The return values point to data that can change or disappear after
the next getgrnam or getgrgid call from that task. Each task manages
its own storage separately. Move data to your own dynamic storage
if you need it for future reference.
- The storage is key 0 non-fetch-protected storage that
is managed by z/OS UNIX System Services.
Example
To get information about the group named SYS1:
"getgrnam SYS1 gr."
say 'Users connected to group SYS1:'
do i=gr_mem to gr.0
say gr.i
end