You are currently on IBM Systems Media’s archival website. Click here to view our new website.

Bookmark and Share

Recent Posts

IBM i Job Accounting and Prestart Server Jobs

December 7, 2015

Last fall, after one of my presentations, I was asked about job accounting and prestart server jobs.  Sharing this information in a blog article seems like a good idea since I’ve fielded similar questions in the past.

I assume most readers know about job accounting and that it can be used to track the use of system resources such as CPU time, transactions, printed output, and more. Job accounting tracks these system resources to a user or group of users.

Prestart server jobs present some unique considerations with regard to job accounting.  In particular, when prestart server jobs are reused, the same job may perform work requests for multiple IBM i users, but after job accounting is set up, how do you track the work done in a prestart server job to a particular user?

To help understand how job accounting works for prestart server jobs, consider how job accounting entries are logged for simple batch or interactive jobs. For these  “traditional” IBM i jobs, the job accounting journal entry is logged when the job ends and summarizes the resources used by that job.

The system automatically tracks the work done in prestart server jobs. 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 that tracks the work 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. This action is similar to the job accounting journal entry being logged at the end of a job. If the prestart server job is used multiple times, there will be multiple job accounting entries logged for that job.

The trick is in 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. Rather, you need to rely upon the accounting code in the journal entry to track the work.

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. A detailed example is also provided.

Posted December 7, 2015| Permalink