Job accounting in a distributed relational database

The job accounting function on the iSeries™ server gathers data so you can determine who is using the server and what server resources they are using. Typical job accounting provides details on the jobs running on a server and resources used, such as use of the processing unit, printer, display stations, and database and communications functions.

Job accounting is optional and must be set up on the server. To set up resource accounting on the server you must:

  1. Create a journal receiver by using the Create Journal Receiver (CRTJRNRCV) command.
  2. Create the journal named QSYS/QACGJRN by using the Create Journal (CRTJRN) command. You must use the name QSYS/QACGJRN and you must have authority to add items to QSYS to create this journal. Specify the names of the journal receiver you created in the previous step on this command.
  3. Change the accounting level server value QACGLVL using the Work with System Values (WRKSYSVAL) or Change System Value (CHGSYSVAL) commands.

    The VALUE parameter on the Change System Value (CHGSYSVAL) command determines when job accounting journal entries are produced. A value of *NONE means the server does not produce any entries in the job accounting journal. A value of *JOB means the server produces a job (JB) journal entry. A value of *PRINT produces a direct print (DP) or spooled print (SP) journal entry for each file printed.

When a job is started, a job description is assigned to the job. The job description object contains a value for the accounting code (ACGCDE) parameter, which can be an accounting code or the default value *USRPRF. If *USRPRF is specified, the accounting code in the job's user profile is used.

You can add accounting codes to user profiles using the accounting code parameter ACGCDE on the Create User Profile (CRTUSRPRF) command or the Change User Profile (CHGUSRPRF) command. You can change accounting codes for specific job descriptions by specifying the desired accounting code for the ACGCDE parameter on the Create Job Description (CRTJOBD) command or the Change Job Description (CHGJOBD) command.

When a job accounting journal is set up, job accounting entries are placed in the journal receiver starting with the next job that enters the server after the Change System Value (CHGSYSVAL) command takes effect.

You can use the OUTFILE parameter on the Display Journal (DSPJRN) command to write the accounting entries to a database file that you can process.

Related concepts
Manage work
Manage the TCP/IP server
Related reference
Account for a distributed relational database
Change Job Description (CHGJOBD) command
Change System Value (CHGSYSVAL) command
Change User Profile (CHGUSRPRF) command
Create Job Description (CRTJOBD) command
Create Journal Receiver (CRTJRNRCV) command
Create Journal (CRTJRN) command
Create User Profile (CRTUSRPRF) command
Display Journal (DSPJRN) command
Work with System Value (WRKSYSVAL) command