IBM i Job Accounting and Prestart Server Jobs
Job accounting can be used to track the use of system resources, such as CPU time, transactions, printed output and more, to a particular user or groups of users.
By Dawn May03/07/2019
Job accounting can be used to track the use of system resources, such as CPU time, transactions, printed output, and more, to a particular user or groups of users.
For simple batch or interactive jobs, the job accounting journal entry is logged when the job ends and summarizes the resources used by that job. Prestart server jobs present some unique considerations with regards to job accounting; in particular, when prestart server jobs are reused, the same job may perform work requests for multiple IBM i users.
When a prestart server job handles a work request, it swaps to the user profile requesting the work. After a job swaps user profiles, the accounting code is changed to that of the user profile that job was swapped to. When the accounting code is changed, a job accounting journal entry is logged which tracks the work that was done up to that point in time. The key point is this journal entry contains the accounting code from the work that was done prior to the creation of the entry. If the prestart server job is used multiple times, there will be multiple job accounting entries logged for that job.
When analyzing the job accounting journal entries, you need to be aware of the fact that the journal entry is logged after the swap of the user profile. Therefore, you cannot use the current user from the journal entry since the current user will already be changed due to the swap of the user profile. In addition, you cannot use the job user name, since that is generally a generic user profile, like QUSER, that does not change for the life of the job. Rather, you need to rely upon the accounting code in the journal entry to track the work. As such, it is important to give some thought to the accounting code used; making it easier to identify the user or group the work was related to will be helpful when using prestart jobs.
An “experience report” was written on Job Accounting. Although this paper was produced in 2004, the information is still pertinent. Within this document, the section, “Analyzing the data” describes how job accounting works with prestart jobs with a detailed example.
This blog was originally published in December 2015. This slightly modified version was published in association of the blog series on prestart jobs.
About the author
Dawn May is an IBM i consultant. She owns Dawn May Consulting, LLC in the Greater Boston area. Dawn is a former IBM senior technical staff member.
See more by Dawn May