How job accounting works

For this overview of how job accounting works, assume three different jobs enter the system.

Figure 1. Job Accounting Overview
  1. When Job1 is completed, the system summarizes the resources used and writes the JB journal entry to the QACGJRN journal. If the accounting code was changed during the job, a JB journal entry will written for each time the accounting code was changed and at the end of the job. Job1 does not make any printer output, and no job log is made. Therefore, no direct print (DP) or spooled print (SP™) journal entries are made for Job1.
  2. Job2 is printing a file directly to a printer. When the file is completed a DP journal entry is written that summarizes the printed data. When Job2 is completed, the system summarizes the resources used and writes the JB journal entry. Job2 does not make any spooled printer output and no job log is made. Therefore, no SP journal entry is made for Job2.
  3. Job3 is printing to a file that is spooled. The SP journal entry is not written unless a print writer prints the file. When Job3 is completed, the system summarizes the resources used and writes the JB journal entry. If a job log is made at the completion of the job, it is considered a normal spooled file and an SP journal entry is created if the file is printed.
  4. A print writer is started and it prints the files made by one or more jobs. When the writer finishes a file, it makes an SP journal entry. The SP journal entry is not made if the file is canceled before printing starts.
  5. At the close of an accounting period, the Display Journal (DSPJRN) command can be used to write the accumulated journal entries into the database file.
  6. User-written programs or the query utility can be used to analyze the accounting data. Reports such as resources used will compile data by a specific accounting code, user, or job type.
Related concepts
When to use job accounting
Security and job accounting
Journal entries for job accounting
About the accounting code
Resource accounting
Resource accounting data
Prestart jobs and job accounting
System job processing for job accounting
Batch processing and job accounting
Interactive processing and job accounting
Printer file accounting
Related information
Job Notification Exit Point