Retrieve User Information (QSYRUSRI) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Receiver variable length Input Binary(4)
3 Format name Input Char(8)
4 User profile name Input Char(10)
5 Error Code I/O Char(*)

  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.


Authorities and Locks

User Profile Authority
*READ

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:

USRI0100 Sign-on and password information is returned. The password itself is not returned.
USRI0200 Authority information is returned.
USRI0300 All user information is returned.

User profile name
INPUT; CHAR(10)

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

*CURRENT The information for the user currently running is returned.

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

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) User profile name
18 12 CHAR(13) Previous sign-on date and time
31 1F CHAR(1) Reserved
32 20 BINARY(4) Sign-on attempts not valid
36 24 CHAR(10) Status
46 2E CHAR(8) Password change date
54 36 CHAR(1) No password indicator
55 37 CHAR(1) Reserved
56 38 BINARY(4) Password expiration interval
60 3C CHAR(8) Date password expires
68 44 BINARY(4) Days until password expires
72 48 CHAR(1) Set password to expire
73 49 CHAR(10) Display sign-on information
83 53 CHAR(1) Local password management


USRI0200 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) User profile name
18 12 CHAR(10) User class name
28 1C CHAR(15) Special authorities
43 2B CHAR(10) Group profile name
53 35 CHAR(10) Owner
63 3F CHAR(10) Group authority
73 49 CHAR(10) Limit capabilities
83 53 CHAR(10) Group authority type
93 5D CHAR(3) Reserved
96 60 BINARY(4) Offset to array of supplemental groups
100 64 BINARY(4) Number of supplemental groups
    ARRAY(*) OF CHAR(10) Supplemental groups


USRI0300 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 CHAR(10) User profile name
18 12 CHAR(13) Previous sign-on date and time
31 1F CHAR(1) Reserved
32 20 BINARY(4) Sign-on attempts not valid
36 24 CHAR(10) Status
46 2E CHAR(8) Password change date
54 36 CHAR(1) No password indicator
55 37 CHAR(1) Reserved
56 38 BINARY(4) Password expiration interval
60 3C CHAR(8) Date password expires
68 44 BINARY(4) Days until password expires
72 48 CHAR(1) Set password to expire
73 49 CHAR(10) User class name
83 53 CHAR(15) Special authorities
98 62 CHAR(10) Group profile name
108 6C CHAR(10) Owner
118 76 CHAR(10) Group authority
128 80 CHAR(10) Assistance level
138 8A CHAR(10) Current library name
148 94 CHAR(10) Initial menu name
158 9E CHAR(10) Initial menu library name
168 A8 CHAR(10) Initial program name
178 B2 CHAR(10) Initial program library name
188 BC CHAR(10) Limit capabilities
198 C6 CHAR(50) Text description
248 F8 CHAR(10) Display sign-on information
258 102 CHAR(10) Limit device sessions
268 10C CHAR(10) Keyboard buffering
278 116 CHAR(2) Reserved
280 118 BINARY(4) Maximum allowed storage
284 11C BINARY(4) Storage used
288 120 CHAR(1) Highest scheduling priority
289 121 CHAR(10) Job description name
299 12B CHAR(10) Job description library name
309 134 CHAR(15) Accounting code
324 144 CHAR(10) Message queue name
334 14E CHAR(10) Message queue library name
344 158 CHAR(10) Message queue delivery method
354 162 CHAR(2) Reserved
356 164 BINARY(4) Message queue severity
360 168 CHAR(10) Output queue name
370 172 CHAR(10) Output queue library name
380 17C CHAR(10) Print device
390 186 CHAR(10) Special environment
400 190 CHAR(10) Attention-key-handling program name
410 19A CHAR(10) Attention-key-handling program library name
420 1A4 CHAR(10) Language ID
430 1AE CHAR(10) Country or region ID
440 1B8 BINARY(4) Character code set ID
444 1BC CHAR(36) User options
480 1E0 CHAR(10) Sort sequence table name
490 1EA CHAR(10) Sort sequence table library name
500 1F4 CHAR(10) Object auditing value
510 1FE CHAR(64) User action audit level
574 23E CHAR(10) Group authority type
584 248 BINARY(4) Offset to array of supplemental groups
588 24C BINARY(4) Number of supplemental groups
592 250 BINARY(4) User ID number
596 254 BINARY(4) Group ID number
600 258 BINARY(4) Offset to home directory
604 25C BINARY(4) Length of home directory
608 260 CHAR(16) Locale job attributes
624 270 BINARY(4) Offset to locale path name
628 274 BINARY(4) Length of locale path name
632 278 CHAR(1) Group member indicator
633 279 CHAR(1) Digital certificate indicator
634 27A CHAR(10) Character identifier control
644 284 BINARY(4) Offset to array of independent ASP storage usage descriptors
648 288 BINARY(4) Number of independent ASP storage usage descriptors
652 28C BINARY(4) Number of independent ASP storage usage descriptors returned
656 290 BINARY(4) Length of an independent ASP storage usage descriptor
660 294 CHAR(1) Local password management
    ARRAY(*)
CHAR(10)
Supplemental groups
    CHAR(*) Home directory
    CHAR(*) Locale path name
    ARRAY(*)
CHAR(*)
Independent ASP storage usage descriptors


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:

*SYSVAL The system value QASTLVL determines which user interface the user is using.
*BASIC The Operational Assistant user interface.
*INTERMED The system user interface.
*ADVANCED The expert system user interface.


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:

*SYSVAL The system value QATNPGM determines the user's Attention-key-handling program.
*NONE No Attention-key-handling program is used.

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:

-2 The system value QCCSID is used to determine the user's character code set ID.

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

This field can contain the following special values:

*SYSVAL The value QCHRIDCTL system value will be used to determine the CHRID control for this user.
*DEVD The *DEVD special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.
*JOBCCSID The *JOBCCSID special value performs the same function as on the CHRID command parameter for display files, printer files, and panel groups.

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

This field can contain the following special value:

*SYSVAL The system value QCNTRYID is used to determine the user's country or region ID.

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 (date-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:

0 The password is expired.
1-7 The number of days until the password expires.
-1 The password will not expire in the next 7 days.

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

Possible values follow:

0 There are no digital certificates associated with this user.
1 There is at least one digital certificates associated with this user.

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:

*SYSVAL The system value QDSPSGNINF determines if the sign-on information display is shown when the user signs on.
*YES The sign-on information display is shown when the user signs on.
*NO The sign-on information display is not shown when the user signs on.

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

The field contains one of the following values:

*NONE The group profile has no authority to the objects the user creates. If the user does not have a group profile, the field contains this value.
*ALL The group profile has all authority to the objects the user creates.
*CHANGE The group profile has change authority to the objects the user creates.
*USE The group profile has use authority to the objects the user creates.
*EXCLUDE The group profile has exclude authority to the objects the user creates.

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:

*PRIVATE The group profile has a private authority to the objects the user creates. If the user does not have a group profile, the field contains this value.
*PGP The group profile will be the primary group for objects the user creates.

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:

0 (*NONE) The user does not have a GID.
1-4294967294 A valid GID.

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

Possible values follow:

0 The user is not a group, or is a group but does not have any members.
1 The user is a group that has members.

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:

Offset Type Field
Dec Hex
0 0 BINARY(4) CCSID of the returned home directory
4 4 CHAR(2) Country or region ID
6 6 CHAR(3) Language ID
9 9 CHAR(3) Reserved
12 C BINARY(4) Flags
16 10 BINARY(4) Number of bytes in the home directory name
20 14 CHAR(2) Home directory delimiter
22 16 CHAR(10) Reserved
32 26 CHAR(*) Home directory name value

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, and the amount of auxiliary storage (in kilobytes) occupied by this user's owned objects on the independent ASP. If the user does not have a maximum amount of allowed storage on an independent ASP, the maximum storage field in the descriptor will be set to -1 for *NOMAX.

The structure for the independent ASP storage usage descriptor is:

Offset Type Field
Dec Hex
0 0 CHAR(10) Independent ASP name
10 A CHAR(2) Reserved
12 C BINARY(4) Maximum allowed storage
16 10 BINARY(4) Storage used

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:

*SYSVAL The system value QKBDBUF determines the keyboard buffering value for this user.
*YES The type-ahead and attention-key buffering options are both on.
*NO The type-ahead and attention-key buffering options are not on.
*TYPEAHEAD The type-ahead option is on, but the attention-key buffering option is not.

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

This field can contain the following special value:

*SYSVAL The system value QLANGID is used to determine the user's language ID.

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.

Limit capabilities. Whether the user has limited capabilities.

The field contains one of the following values:

*PARTIAL The user cannot change his initial program or current library.
*YES The user cannot change his initial menu, initial program, or current library. The user cannot run commands from the command line.
*NO The user is not limited.

Limit device sessions. Whether the user is limited to one device session.

The field contains one of the following values:

*SYSVAL The system value QLMTDEVSSN determines if the user is limited to one device session.
*YES The user is limited to one device session.
*NO The user is not limited to one device session.

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:

*NONE CHAR(1)

No job attributes are used from the locale path name at the time a job is started for this user profile.

*SYSVAL CHAR(1)

The job attributes assigned from the locale path name are determined by the system value QSETJOBATR at the time a job is started for this user profile.

*CCSID CHAR(1)

The coded character set identifier is set from the locale path name at the time a job is started for this user profile.

*DATFMT CHAR(1)

The date format is set from the locale path name at the time a job is started for this user profile.

*DATSEP CHAR(1)

The date separator is set from the locale path name at the time a job is started for this user profile.

*SRTSEQ CHAR(1)

The sort sequence is set from the locale path name at the time a job is started for this user profile.

*TIMSEP CHAR(1)

The time separator is set from the locale path name at the time a job is started for this user profile.

*DECFMT CHAR(1)

The decimal format is set from the locale path name at the time a job is started for this user profile.

Reserved CHAR(8)

An ignored field.

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:

*C The C locale path name is assigned.
*NONE No locale path name is assigned.
*POSIX The POSIX locale path name is assigned.
*SYSVAL The QLOCALE system value is used to determine the locale path name.

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

Offset Type Field
Dec Hex
0 0 BINARY(4) CCSID
4 4 CHAR(2) Country or region ID
6 6 CHAR(3) Language ID
9 9 CHAR(3) Reserved
12 C BINARY(4) Flags
16 10 BINARY(4) Locale path name length
20 14 CHAR(2) Locale path name delimiter character
22 16 CHAR(10) Reserved
32 26 CHAR(*) Locale path name

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.

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:

*BREAK The job to which the message queue is assigned is interrupted when a message arrives on the message queue.
*DFT Messages requiring replies are answered with their default reply.
*HOLD The messages are held in the message queue until they are requested by the user or program.
*NOTIFY The job to which the message queue is assigned is notified when a message arrives on the message queue.

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.

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.

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.

Start of changeNote: The user must have either *ALLOBJ or *AUDIT special authority to retrieve the object auditing value.End of change

The field contains one of the following values:

*NONE No additional object auditing is done for the current user.
*CHANGE Object changes are audited for the current user if the object's auditing value is *USRPRF.
*ALL Object read and change operations are audited for the current user if the object's auditing value is *USRPRF.
Start of change*NOTAVL The user is not allowed to retrieve the object auditing value.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.

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.

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

This field can contain one of the following special values:

*WRKSTN The output queue assigned to the user's work station is used.
*DEV An output queue with the same name as the device specified in the printer device parameter is used by the user.

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:

*USRPRF The user owns any objects the user creates. If the user does not have a group profile, the field contains this value.
*GRPPRF The user's group profile owns any objects the user creates.

Password change date. The date the user's password was last changed, in *DTS (date-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:

0 The system value QPWDEXPITV is used to determine the user's password expiration interval.
-1 The user's password does not expire (*NOMAX).

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:

*WRKSTN The printer assigned to the user's work station is used.
*SYSVAL The default system printer specified in the system value QPRTDEV is used.

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:

Y The user's password is set to expire.
N The user's password is not set to expire.

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:

*HEX The hexadecimal values of the characters are used to determine the sort sequence.
*LANGIDUNQ A unique-weight sort table associated with the language specified.
*LANGIDSHR A shared-weight sort table associated with the language specified.
*SYSVAL The system value QSRTSEQ.

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:

*ALLOBJ CHAR(1)

All object. Whether the user has all object special authority.

*SECADM CHAR(1)

Security administrator. Whether the user has security administrator special authority.

*JOBCTL CHAR(1)

Job control. Whether the user has job control special authority.

*SPLCTL CHAR(1)

Spool control. Whether the user has spool control special authority.

*SAVSYS CHAR(1)

Save system. Whether the user has save system special authority.

*SERVICE CHAR(1)

Service. Whether the user has service special authority.

*AUDIT CHAR(1)

Audit. Whether the user has audit special authority.

*IOSYSCFG CHAR(1)

Input/output system configuration. Whether the user has input/output system configuration special authority.

Reserved CHAR(7)

An ignored field.

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

This field contains one of the following special values:

*SYSVAL The system value QSPCENV is used to determine the user's special environment.
*NONE The user operates in the i5/OS environment.
*S36 The user operates in the System/36 environment.

Status. The status of the user profile.

This field contains one of the following values:

*ENABLED The user profile is enabled; therefore, the user is able to sign on.
*DISABLED The user profile is disabled; therefore, the user cannot sign on.

Storage used. 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. Start of changeIf 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.End of change

This field contains the following:

*CMD CHAR(1)

The user has the *CMD audit value specified in the user profile.

*CREATE CHAR(1)

The user has the *CREATE audit value specified in the user profile.

*DELETE CHAR(1)

The user has the *DELETE audit value specified in the user profile.

*JOBDTA CHAR(1)

The user has the *JOBDTA audit value specified in the user profile.

*OBJMGT CHAR(1)

The user has the *OBJMGT audit value specified in the user profile.

*OFCSRV CHAR(1)

The user has the *OFCSRV audit value specified in the user profile.

*OPTICAL CHAR(1)

The user has the *OPTICAL audit value specified in the user profile.

*PGMADP CHAR(1)

The user has the *PGMADP audit value specified in the user profile.

*SAVRST CHAR(1)

The user has the *SAVRST audit value specified in the user profile.

*SECURITY CHAR(1)

The user has the *SECURITY audit value specified in the user profile.

*SERVICE CHAR(1)

The user has the *SERVICE audit value specified in the user profile.

*SPLFDTA CHAR(1)

The user has the *SPLFDTA audit value specified in the user profile.

*SYSMGT CHAR(1)

The user has the *SYSMGT audit value specified in the user profile.

Reserved CHAR(51)

An ignored field.

User class name.

This field contains one of the following special values:

*SECOFR The user has a class of security officer.
*SECADM The user has a class of security administrator.
*PGMR The user has a class of programmer.
*SYSOPR The user has a class of system operator.
*USER The user has a class of end user.

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 profile name. The name of the user profile for which the information is returned.


Error Messages

Message ID Error Message Text
CPF2203 E User profile &1 not correct.
CPF2225 E Not able to allocate internal system object.
CPF3CF1 E Error code parameter not valid.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C24 E Length of the receiver variable is not valid.
CPF3C90 E Literal value cannot be changed.
CPF9801 E Object &2 in library &3 not found.
CPF9802 E Not authorized to object &2 in &3.
CPF9803 E Cannot allocate object &2 in library &3.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R2
Top | Security APIs | APIs by category