AS/400 User Profile

5 pts.
AS/400 user profiles
We would like to add the user employee number in the profile.  The accounting code is currently used for the cost center and we do not want to add it in the description field.

Software/Hardware used:
AS400 520 - V5r4

Answer Wiki

Thanks. We'll let you know when a new response is added.

There is a field in the user profile called User ID number. You might be able to use it for what you need.

According to the help screen:

User ID number (UID) – Help

Specifies the user ID number (uid number) for this user profile. The uid number is used to identify the user when the user is using the directory file system. The uid number for a user cannot be changed if there are one or more active jobs for the user.

The value does not change.

Specify the uid number to be assigned to the user
profile. A value from 1 to 4294967294 can be entered.
The uid number assigned must not already be assigned
to another user profile.


Accounting code is a char(15) value. I’ve never needed more than nine characters for actual “accounting codes”, usually leaving six characters for additional info. I usually use those last six characters when calling certain functions that need special consideration — the functions update the code of the job (CHGACGCDE) at run-time to tag the usage of the function and return the characters to blanks when the function ends. Since job accounting can report by *generic accounting codes, processes can be grouped in many ways.

You could partition accounting code to have two parts if your codes could be normalized into identifiers of appropriate sizes.

Description is also available for partitioning into parts.

But those are both eliminated from consideration. Using any other attribute brings a potential for interference with any system or home-grown (or 3rd-party) function that relies on a valid value in that attribute.

The System Directory (WRKDIRE, etc.) might be useful. There are various commands and APIs that can store and retrieve user-defined attributes per user ID.

However, a user ID doesn’t necessarily equal a user profile. User IDs are limited to char(8) in length and are associated with user profiles. That brings a complication in creating any application as well as bringing a need actually to enroll users in the system directory.

One other possibility seems appropriate in releases of i5/OS and later — the User Application APIs. IIRC, info stored with these APIs gets saved/restored along with the user profiles — you need to verify that. The info isn’t exactly stored as part of the user profile; it’s likely stored in some related index object that the system knows needs to be maintained alongside of the profile.

The APIs might be wrapped in stored procs or UDFs for use with queries. It might be possible to integrate these into any application that you have in mind as long as it doesn’t need to support earliers releases.


Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    The uid attribute of a user profile should not (and in many cases, can not) be used for anything but a uid value. Technically, the assigned uid should be coordinated across all systems in the network that use uids -- Linux, Unix, iSeries, and perhaps others. It might be noticed by iSeries users most often on NFS connections. The value should not be changed so that a uid on, for example, a connected Linux system matches an unrelated profile on the iSeries -- in the eyes of Linux, a matching uid indicates a matching user. IBM sets many IBM profiles to have specific uids. That in itself could conflict with a secondary scheme to match uid with employee number (not to mention confusing the system on how to assign authority). The problem with the question is that it asks how to assign an attribute that doesn't belong in a user profile to a user profile. Further, the two attributes that might make sense -- accounting code and description -- have been eliminated. The reasonable direction is not to put "employee number" into user profiles at all. (It doesn't belong there.) Instead, a table should be created with at least two columns -- user profile and employee number. Associate the profile name with employee number through the table. In a sense, such a table already exists. It is available through the System Directory functions. Tom
    125,585 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: