Problem solve Get help with specific problems with your technologies, process and projects.

How to set up a system resource accounting system -- Part 1

Need to determine which users or departments are doing what? The iSeries is set up to provide such information through a system resource accounting system.

No, this is not monetary accounting with debits, credits, ledgers and journals. We're going to discuss iSeries system resource accounting. System resource accounting is important to many shops whose IS budget and cost of iSeries ownership must be allocated to individual users and/or departments. Luckily, the iSeries is set up to provide you with the information to do just that.

Basic accounting setup
The iSeries contains a system value, QACGLVL, that controls the logging of resource utilization information. The system value is shipped with a default value of *NONE -- no resource utilization information is logged.

The QACGLVL system value supports two other values, *JOB and/or *PRINT (in case you didn't notice the "and/or," the QACGLVL system value can be set to both *JOB and *PRINT).

When QACGLVL is set to *JOB, the system will log resource utilization information for every job that runs. The system will log such things as CPU usage, auxiliary storage I/O counts, database put/get/delete counts, and communications put/get counts.

Ron Turull

When set to *PRINT, the system will log print resource utilization information, such as number of lines and pages printed. Note: The print statistics reflect only the number of lines and pages printed to a printer file, not necessarily the number of line and pages actually printed by a printer.

I have found no evidence that turning on system accounting has any significant impact on system performance. However, I can't speak for your system. On the other hand, it is important to remember that most, if not all, of this information is already logged for other purposes, such as the WRKDSKSTS (Work with Disk Status) command and the WRKSYSSTS (Work with System Status) command.

How to create an accounting logging journal
Before activating the QACGLVL system value, you must create a journal and journal receiver into which the system can log the resource utilization information. The journal must be named QACGJRN and must be in the QSYS library, but you can call the journal receiver anything you like.

For those not familiar with journaling, here are the commands you need:

CRTJRNRCV JRNRCV(QSYS/QACGJRN) TEXT('Accounting journal receiver')

Once completed, you can turn on system accounting by changing the QACGLVL system value to *JOB and/or *PRINT. Thereafter, each time a job ends, the system will write an entry to the journal. We'll discuss what to do with those journal entries momentarily.

Categorizing users
Many shops don't need system resource utilization information for each user. What many want is a way to allocate system resource utilization costs to the different departments in a company.

To do this, you need to "categorize" or "departmentalize" each user profile. Each user profile object has an Accounting Code attribute. It can be set or changed using either the CRTUSRPRF or CHGUSRPRF command. For example, to put user John Doe into the Customer Service department, you could use the following command:


The accounting codes you use can be anything you want and must be set for every user you want to categorize. Once that is done, each job, when started, will have an accounting code assigned to it -- the accounting code of the user who starts the job. The system will then include the accounting code in the journal entries.

How to utilize the accounting journal entries
Logging entries to the accounting journal is the extent of what the system will do for you. The rest is up to you. From here you will need to do the following three steps:

  1. Pull the journal entries out of the journal receiver(s)
  2. Filter and summarize the entries
  3. Most likely, create some kind of report from them. You can create an elaborate report program or a simple query -- it's up to you

In my June 25 Administrator Tip, we'll go through these steps one by one and discuss real examples along the way.

About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years experience programming for and managing AS/400-iSeries systems.


  • Usage of the system by different users
    A user asked, "I need to collect information of the usage of the system by different users in order to bill them according to the time a user has been logged into the system. Is there anyway I can achieve it through any of the IBM iSeries tools, or are there any other tools available?" Site expert Ken Graap had some advice.
  • Additional techniques for finding system information
    Here are some suggestions for determining the amount of working memory as well as the total and free DASD on a system.
  • Search for the guilty party Sometimes it is nice to be able to backtrack and see who did what and when they did it. Here's an easy way to implement a tracking system on an OS/400 database -- without any significant programming on your part. This technique takes advantage of the OS/400 database audit journal features.

Dig Deeper on Implementation