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


getpwent

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

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

Function

getpwent invokes the getpwent callable service to retrieve a user database entry.

Parameters

stem
The name of a stem variable used to return the information. Upon return, stem.0 contains the number of variables returned. You can use a numeric value (see REXX predefined variables) or the predefined variables beginning with PW_ to access the values:
Variable Description
PW_DIR The initial working directory
PW_GID The group ID
PW_NAME The TSO/E user ID
PW_SHELL The name of the initial user program.
PW_UID The user ID (UID) as defined to RACF®.

Usage notes

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

Example

To list all users in the user database:
"getpwent pw."

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