Retrieve User Information (QSYRUSRI) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve User Information (QSYRUSRI) API provides information about a user profile. This API provides information similar to the Retrieve User Profile (RTVUSRPRF) command or the Display User Profile (DSPUSRPRF) command when *BASIC is specified for the type parameter.

The QSYS2.USER_INFO, QSYS2.USER_INFO_BASIC, and QSYS2.USER_STORAGE views can be used as alternatives to this API. See USER_INFO view, USER_INFO_BASIC view, and USER_STORAGE view for more information.


Authorities and Locks

User Profile Authority
*READ or be authorized to the Database Administrator function of the IBM i through System i™ Navigator's Application Administration support. The Change Function Usage (CHGFCNUSG) command, with a function ID of QIBM_DB_SECADM, can also be used to change the list of users allowed to use the function.

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable used to return the information about the user. This variable must be at least 8 bytes long.

Receiver variable length
INPUT; BINARY(4)

The length of the receiver variable. The variable must be 8 bytes long.

Format name
INPUT; CHAR(8)

The name of the format used to return information about the user.

You can specify these formats:


User profile name
INPUT; CHAR(10)

The user name for which information is returned. You can specify the following special value:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Receiver Variable Description

The following tables describe the order and format of the data returned in the receiver variable. For detailed descriptions of the fields in the tables, see Field Descriptions.

USRI0100 Format



USRI0200 Format



USRI0300 Format



Field Descriptions

Accounting code.

The accounting code that is associated with this user. If the user does not have an accounting code, this field is blank.

Assistance level. The user interface that the user will use.

The field contains one of the following values:



Attention-key-handling program library name. The name of the library where the program is located. This field can contain the special value of *LIBL. If the program name is a special value, this field is blank.

Attention-key-handling program name. The Attention-key-handling program for this user.

This field may contain one of the following special values:

Start of changeAuthority collection active indicator. Whether authority collection is active for this user.

Possible values follow:

Start of changeAuthority collection repository exists indicator. Whether an authority collection repository exists for this user.

Possible values follow:

Block password change. Specifies the time period, in hours, during which a password is blocked from being changed following the prior successful password change operation.

This field may contain one of the following special values:

Bytes available. The number of bytes of data available to be returned to the user. If all data is returned, this is the same as the number of bytes returned. If the receiver variable was not big enough to contain all of the data, this is the number of bytes that can be returned.

Bytes returned. The number of bytes of data returned to the user. This is the lesser of the number of bytes available to be returned or the length of the receiver variable.

Character code set ID. The character code set ID to be used by the system f or this user.

This field can contain the following special value:

Character identifier control. The character identifier control for the user.

This field can contain the following special values:

Country or region ID. The country or region ID used by the system for this user.

This field can contain the following special value:

Current library name. This field contains the name of the user's current library. If the user does not have a current library, this field is *CRTDFT.

Date password expires. The date the user's password expires, in *DTS (System time-stamp) format. If the user's password will not expire (password expiration interval of *NOMAX) or the user's password is set to expire, then this field is blank.

Days until password expires. The number of days until the password will expire.

This field contains one of the following values:

Start of changeDelete collection. Whether the authority information previously collected for this user by the STRAUTCOL command is deleted before this authority collection begins.

This field contains one of the following values:

End of change

Start of changeDetail. The details that are used by the STRAUTCOL command to determine whether an authority check is for a unique instance. One unique instance is collected for each check.

This field contains one of the following values:

End of change

Digital certificate indicator. Whether there are digital certificates associated with this user.

Possible values follow:

Display sign-on information. Whether the sign-on information display is shown when the user signs on.

The field contains one of the following values:

Start of changeDocument library object (DLO) object type. The array of DLO object types that will have authority information collected when an authority check is performed by the system.

The array element may contain one of the following special values:

End of change

Start of changeFile system object type. The array of file system object types in the "root" (/), QOpenSys, and user-defined file systems that will have authority information collected when an authority check is performed by the system.

The array element may contain one of the following special values:

End of change

Group authority. The authority the user's group profile has to objects the user creates.

The field contains one of the following values:

Group authority type. The type of authority the user's group profile has to objects the user creates.

The field contains one of the following values:

Group ID number. The group ID number for the user profile. The group ID number is used to identify the user when it is a group and a member of the group is using the integrated file system.

Possible values follow:

Group member indicator. Whether this user is a group that has members.

Possible values follow:

Group profile name. The name of the group profile. If the user does not have a group profile, this field is *NONE.

Highest scheduling priority. The highest scheduling priority the user is allowed to have for each job submitted to the system. The priority is a value from 0 through 9, with 0 being the highest priority.

Home directory. The home directory for this user profile. The home directory is the user's initial working directory. The working directory, associated with a process, is used in path name resolution in the directory file system for path names that do not begin with a slash (/).

The structure for the home directory name returned is:

Independent ASP storage usage descriptors An array of descriptors that contains the name of the independent ASP, the maximum amount of auxiliary storage (in kilobytes) that can be assigned to store permanent objects owned by the user on the independent ASP (4-byte and 8-byte fields), and the amount of auxiliary storage (in kilobytes) occupied by this user's owned objects on the independent ASP (4-byte and 8-byte fields). If the user does not have a maximum amount of allowed storage on an independent ASP, the "Maximum allowed storage" field in the descriptor will be set to -1 for *NOMAX. The "Maximum allowed storage (long)" field in the descriptor will be set to 9,223,372,036,854,775,807 (0x7FFFFFFFFFFFFFFF) for *NOMAX.

If the maximum allowed storage value or the storage used value is larger than 2,147,483,647 kilobytes (the maximum amount a 4-byte field can hold), the corresponding 4-byte field will contain -2. The "Maximum allowed storage (long)" or the "Storage used (long)" field should be used to get the actual value.

The structure for the independent ASP storage usage descriptor is:

Initial menu name. The initial menu for the user. This field can contain the special value *SIGNOFF.

Initial menu library name. The name of the library that the initial menu is in. This field can contain the special value of *LIBL. If the menu name is *SIGNOFF, this field is blank.

Initial program name. The initial program for the user. If the user does not have an initial program, this field is *NONE.

Initial program library name. The name of the library that the initial program is in. This field can contain the special value of *LIBL. If the program name is *NONE, this field is blank.

Job description name. The name of the job description used for jobs that start through subsystem work station entries.

Job description library name. The name of the library that the job description is in. This field can contain the special value *LIBL.

Keyboard buffering. This field indicates the keyboard buffering value that is used when a job is initialized for this user.

The field contains one of the following values:

Language ID. The language ID used by the system for this user.

This field can contain the following special value:

Length of an independent ASP storage usage descriptor. The length (in bytes) of one independent ASP storage usage descriptor.

Length of home directory. The length (in bytes) of the home directory entry.

Length of locale path name. The length (in bytes) of the locale path name.

Start of changeLength of Start Authority Collection (STRAUTCOL) command parameters. The length (in bytes) of the STRAUTCOL command parameters. This value will be zero if an authority collection repository does not exist for this user. This value will also be zero if an authority collection repository exists for this user but the receiver variable is not large enough to contain the fixed portion of the STRAUTCOL parameter information structure.End of change

Start of changeLibrary name. The array of library and ASP device pairs that will be searched for objects. The first 10 characters of the array element will contain the library name, the second 10 characters will contain the ASP device name. The ASP device name may be *SYSBAS.

The array element may contain one of the following special values in the first 10 characters, the second 10 characters will be blanks:

End of change

Limit capabilities. Whether the user has limited capabilities.

The field contains one of the following values:

Limit device sessions. Specifies if the number of device sessions allowed for a user is limited.

The field contains one of the following values:

Locale job attributes. The job attributes that are taken from the user's locale path name. If a particular job attribute is taken from the locale path name, the specific field is Y (yes). If not, the specific field is N (no).

The possible values follow:

Locale path name. The locale path name that is assigned to the user profile when a job is started. This field can contain a special value or a locale path name. If a special value is returned, the length of the value is 10 and the value returned is one of the following:

If the value returned in this field is not a special value, it is returned in the following format.

Local password management. If password is managed locally, this field contains a Y. If not, this field is N.

Maximum allowed storage. The maximum amount of auxiliary storage (in kilobytes) that can be assigned to store permanent objects owned by the user. If the user does not have a maximum amount of allowed storage, this field contains -1 for *NOMAX. If the maximum allowed storage value is larger than 2,147,483,647 kilobytes (the maximum amount a 4-byte field can hold), this field will contain -2. The field "Maximum allowed storage (long)" should be used instead of this field to get the actual value.

Maximum allowed storage (long). The maximum amount of auxiliary storage (in kilobytes) that can be assigned to store permanent objects owned by the user. If the user does not have a maximum amount of allowed storage, this field contains 9,223,372,036,854,775,807 (0x7FFFFFFFFFFFFFFF) for *NOMAX.

Message queue name. The name of the message queue that is used by this user.

Message queue library name. The name of the library the message queue is in. This field can contain the special value *LIBL.

Message queue delivery method. How the messages are delivered to the message queue used by the user. This field contains one of the following special values:

Message queue severity. The lowest severity that a message can have and still be delivered to a user in break or notify mode. The severity is a value from 0 through 99.

No password indicator. If *NONE is specified for the password in the user profile, this field contains a Y. If not, this field is N.

Start of changeNumber of Document library object (DLO) object types. The number of DLO object type array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the DLO object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeNumber of file system object types. The number of file system object type array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the file system object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Number of independent ASP storage usage descriptors. The total number of independent ASP storage usage descriptors. The number of independent ASP storage usage descriptors will be 0 if the user does not own any objects on any independent ASPs.

Number of independent ASP storage usage descriptors returned. The number of independent ASP storage usage descriptors returned in the array. The number of independent ASP storage usage descriptors will be 0 if the user does not own any objects on any independent ASPs.

Start of changeNumber of library names. The number of library and ASP device name array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the library and ASP device name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeNumber of object names. The number of object name array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the object name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeNumber of object types. The number of object type array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeNumber of omit library names. The number of omit library and ASP device name array elements contained in the STRAUTCOL parameter information structure. This value will be zero if the receiver variable is not large enough to contain all of the omit library and ASP device name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Number of supplemental groups. The number of supplemental groups. The number of supplemental groups will be zero if the user does not have any supplemental groups.

Object auditing value. The current user's object auditing value.

Note: The user must have either *ALLOBJ or *AUDIT special authority to retrieve the object auditing value.

The field contains one of the following values:

Start of changeObject name. The array of objects for which authority information will be collected when an authority check is performed by the system.

The array element may contain one of the following special values:

End of change

Start of changeObject type. Objects of these object types will have authority information collected when an authority check is performed by the system.

The array element may contain one of the following special values:

End of change

Start of changeOffset to array of Document library object (DLO) object types. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of DLO object types. This value will be zero if the receiver variable is not large enough to contain all of the DLO object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeOffset to array of file system object types. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of file system object types. This value will be zero if the receiver variable is not large enough to contain all of the file system object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Offset to array of independent ASP storage usage descriptors. The offset from the beginning of the receiver variable to the start of the array of independent ASP storage usage descriptors.

Start of changeOffset to array of library names. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of library and ASP device names. This value will be zero if the receiver variable is not large enough to contain all of the library and ASP device name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeOffset to array of object names. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of object names. This value will be zero if the receiver variable is not large enough to contain all of the object name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeOffset to array of object types. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of object types. This value will be zero if the receiver variable is not large enough to contain all of the object type array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Start of changeOffset to array of omit library names. The offset from the beginning of the STRAUTCOL parameter information structure to the start of the array of omit library and ASP device names. This value will be zero if the receiver variable is not large enough to contain all of the omit library and ASP device name array elements and all of the STRAUTCOL variable length data that is put into the receiver variable before these values.End of change

Offset to array of supplemental groups. The offset from the beginning of the receiver variable to the start of the array of supplemental groups.

Offset to home directory. The offset from the beginning of the receiver variable to the start of the home directory entry.

Offset to locale path name. The offset from the beginning of the receiver variable to the start of the locale path name.

Start of changeOffset to Start Authority Collection (STRAUTCOL) command parameters. The offset from the beginning of the receiver variable to the start of the STRAUTCOL command parameters. This value will be zero if an authority collection repository does not exist for this user. This value will also be zero if an authority collection repository exists for this user but the receiver variable is not large enough to contain the fixed portion of the STRAUTCOL parameter information structure.End of change

Start of changeOmit library name. The array of omit library and ASP device pairs that will be excluded from the authority collection operation. The first 10 characters of the array element will contain the omit library name, the second 10 characters will contain the ASP device name. The ASP device name may be *SYSBAS.

The array element may contain the following special value in the first 10 characters, the second 10 characters will be blanks:

End of change

Output queue name. The output queue used by this user.

This field can contain one of the following special values:

Output queue library name. The name of the library where the output queue is located. This field can contain the special value *LIBL. If the output queue is *WRKSTN or *DEV, this field is blank.

Owner. This field indicates who is to own objects created by this user.

The field contains one of the following values:

Password change date. The date the user's password was last changed, in *DTS (System time-stamp) format.

Password expiration interval. The number of days (from 1 through 366) the user's password can remain active before it must be changed.

This field may contain one of the following special values:

Previous sign-on date and time. The date and time the user last signed on. The 13 characters are:

If the user has never signed on the system, this field is blank.

Print device. The printer used to print for this user.

This field can contain one of the following special values:

Reserved. An ignored field.

Set password to expire. Whether the user's password is set to expire, requiring the user to change the password when signing on.

This field contains one of the following values:

Sign-on attempts not valid. The number of sign-on attempts that were not valid since the last successful sign-on.

Sort sequence table name. The name of the sort sequence table used for string comparisons. The following possible special values can also be returned:

Sort sequence table library name. The name of the library that is used to locate the sort sequence table. This information is blank if the program does not contain any sort sequence information.

Special authorities. The special authorities the user has. If the user has the special authority, the field is Y. If not, the field is N.

This field contains the following fields:

Special environment. The special environment the user operates in after signing on.

This field contains one of the following special values:

Start of changeStart Authority Collection (STRAUTCOL) command parameters. The authority collection information available for this user was collected using these parameter values the last time the STRAUTCOL command was run.

The structure for the STRAUTCOL parameter information is:

End of change

Status. The status of the user profile.

This field contains one of the following values:

Storage used. The amount of auxiliary storage (in kilobytes) occupied by this user's owned objects. If the storage used value is larger than 2,147,483,647 kilobytes (the maximum amount a 4-byte field can hold), this field will contain -2. The field "Storage used (long)" should be used instead of this field to get the actual value.

Storage used (long). The amount of auxiliary storage (in kilobytes) occupied by this user's owned objects.

Supplemental groups. The array of supplemental groups for the user profile.

Text description. The descriptive text for the user profile.

User action audit level. The action audit values for this user. If the user has a specific audit value, the field is Y. If not, the field is N. If the user is not allowed to retrieve the action audit level, the field is blank.

Note: The user must have either *ALLOBJ or *AUDIT special authority to retrieve the user action audit level.

This field contains the following:

User class name. This field contains one of the following special values:

User ID number. The user ID (UID) number for the user profile. The UID is used to identify the user when it is using the integrated file system.

User options. The options for users to customize their environment. This field contains the following fields:

User entitlement required. Whether a user entitlement is required for this user profile. This field should be ignored on systems that do not have feature 5052 installed.

Possible values follow:

User expiration action. The action that will occur when the user profile has expired.

This field may contain one of the following special values:

User expiration date. The date, in *DTS (System time-stamp) format when the user profile expires and is automatically disabled or deleted. If the User expiration interval field is not 0, the system generated the user expiration date using the specified interval. If the user profile will not expire, then this field is blank.

User expiration interval. The number of days (from 1 through 366) before the user profile is automatically disabled. If this field is not 0, the User expiration date field contains the date when the user profile expires and is automatically disabled. A user expiration date is generated by the system using the user expiration interval when a user profile is created or when an expired user profile is re-enabled. If the user profile does not have a user expiration interval, this field contains 0.

User profile name. The name of the user profile for which the information is returned.


Error Messages



API introduced: V2R2

[ Back to top | Security APIs | APIs by category ]