Setting up job accounting

To set up job accounting, use the character based interface.

  1. Create a journal receiver. The journal receiver can be created with any name and library you choose. It is recommended to give it a name with a naming convention such as ACGJRN1 so that additional receivers (such as ACGJRN2, ACGJRN3) can be created with the Change Journal CHGJRN JRNRCV(*GEN) command.
    1. Command: Create Journal Receiver (CRTJRNRCV)
      CRTJRNRCV JRNRCV(USERLIB/ACGJRN1)
  2. Create the job accounting journal. The journal name must be QSYS/QACGJRN, and you need authority to add objects to the QSYS library.
    1. Command: Create Journal (CRTJRN)
      CRTJRN JRN(QSYS/QACGJRN) JRNRCV(USERLIB/ACGJRN1) AUT(*EXCLUDE)
      The journal receiver should be the same as the receiver created in step 1. The authority can be set to anything you choose, but *EXCLUDE is recommended since the data collected can be used to charge users for resource usage.
  3. Change the journal accounting information (QACGLVL) system value. The system value can be set to journal job accounting information, or printer information, or both. *JOB produces job (JB) journal entries, while *PRINT produces direct print (DP) or spooled print (SP) journal entries. A value of *NONE means no journaling is done for journal QACGJRN. Job accounting data will only be journaled for jobs that are started after the system value has been set to a value other than *NONE.
    1. Command: Work with System Values (WRKSYSVAL) or Change System Value (CHGSYSVAL)
      CHGSYSVAL SYSVAL(QACGLVL) VALUE('*JOB *PRINT')
  4. Set the accounting code parameter ACGCDE for each user profile. The accounting code can be set to any alphanumeric string up to 15 characters in length. If determining the current user is important to your analysis of a job accounting journal entry, it is recommended that you set the ACGCDE parameter to the user profile's name.
    1. Command: Change User Profile (CHGUSRPRF) or Create User Profile (CRTUSRPRF)
      CHGUSRPRF USRPRF(USERID1) ACGCDE(USERID1)
      The accounting code can also be specified for a group of users by using the Change Job Description (CHGJOBD) or Create Job Description (CRTJOBD) commands.

      The default accounting code for job descriptions is *USRPRF, which means it uses the accounting code from the job's user profile. If a value other than *USRPRF is specified in the job description, it will take precedence over the accounting code specified in the user profile