Job accounting
The job accounting function gathers data so that you can determine who is using your system and what system resources they are using. It also assists you in evaluating the overall use of your system. Job accounting is optional. You must take specific steps to set up job accounting. You can request the system to gather job resource accounting data, printer file accounting data, or both. You can also assign accounting codes to user profiles or specific jobs.
Typical job accounting data details the jobs running in your system and the resources they are using such as the use of the processing unit, printer, display stations, database and communications functions.
Job accounting statistics are kept by using the journal entries made in the system accounting journal QSYS/QACGJRN. You should know how to perform journal management operations, such as saving a journal receiver, changing journal receivers, and deleting old journal receivers.
When you want to analyze the job accounting data, it must be extracted from the QACGJRN journal by use of the Display Journal (DSPJRN) command. With this command you can write the entries into a database file. You must write application programs or use a utility such as the query utility to analyze the data.
- How job accounting works
For this overview of how job accounting works, assume three different jobs enter the system.- When to use job accounting
These methods help you determine whether you should use job accounting and when to use job accounting.- Security and job accounting
Only the security officer (or a program adopting his authority) or a user with *ALLOBJ and *SECADM authority can change the Journal accounting information (QACGLVL) system value.- About the accounting code
The initial accounting code (up to 15 characters in length) for a job is determined by the value of the ACGCDE (accounting code) parameter in the job description and user profile for the job.- Resource accounting
Job resource accounting data is summarized in the job (JB) journal entry at the completion of a job. In addition, the system creates a JB journal entry summarizing the resources used each time a Change Accounting Code (CHGACGCDE) command occurs. The JB journal entry includes:- Resource accounting data
When analyzing the journal entries, it is important to understand how and when journal entries are written. A JB journal entry is written to the job accounting journal for a job any time the job accounting code is changed and when the job ends. Therefore, one job may have multiple journal entries.- Prestart communications jobs and job accounting
If your system uses job accounting, the prestart job program should run the Change Prestart Job (CHGPJ) command with the program start request value for the accounting code parameter (CHGPJ ACGCDE(*PGMSTRRQS)) immediately after the program start request attaches to the prestart job.- System job processing for job accounting
System jobs that you control (for example, readers and writers) are assigned an accounting code of *SYS. Other system jobs that you do not control (for example, QSYSARB, QLUS,SCPF) do not receive a journal entry.- Job Notification Exit Point
The job notification exit point can be used as an alternative to job accounting. This depends on what information you are interested in.- Batch processing and job accounting
Any batch job that is submitted using the Submit Job (SBMJOB) command automatically uses the same accounting code as the job that submitted the batch job. When the SBMJOB command is used, the accounting codes cannot be overridden regardless of how the job description entry is coded.- Interactive processing and job accounting
If an interactive job has a fixed set of options for a user and each option has an assigned accounting code, it might be desirable to automatically assign a new code when the user requests to work on a new function.- Printer file accounting
There are two types of journal entries for printer file accounting; DP for nonspooled printer files and SP for spooled printer files. These two types of journal entries share a common journal entry format although some of the information is only available in the SP entry. The DP and SP journal entries include information such as:- Journal entries for job accounting
The system provides different journal entries for the different types of data that can be gathered:
Parent topic:
ConceptsRelated concepts
Managing job accounting