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


getgrent

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

Read syntax diagramSkip visual syntax diagram
>>-getgrent--stem----------------------------------------------><

Function

getgrent invokes the getgrent callable service to retrieve a group database entry.
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

  1. The service is intended to be used to search the group database sequentially. The first call to this service from a given task returns the first group entry in the group database. Subsequent calls from the same task return the next group entry found, until no more entries exist, at which time a RETVAL of 0 is returned.
  2. The setgrent service can be used to reset this sequential search.

Example

To list all groups in the group data base:
"getgrent gr."

For a complete example, see List all users and groups.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014