Troubleshooting
Problem
This note addresses how to generate reports using Job Accounting Journal information.
Resolving The Problem
The manual talks about logical files, high level language programs, DDS, and so on. Is there an easier way to generate an accounting report?
If you know Query, you can generate some simple reports. In the Converting Job Accounting Journal Entries section of the Job Accounting chapter in the OS/400 Work Management Manual, it says the fields for the accounting records are in files QSYS/QAJBACG and QSYS/QAPTACG. But it does not really say how to use them. Actually, files QSYS/QAJBACG4 and QSYS/QAPTACG4 should be used instead.
Note: For the rest of this document, we will work only with the job accounting records (JB type entries). It should work similarly for the spool records; however, they must be done separately.
First, create a database file to receive the accounting records from the journal. It is easiest to just create a duplicate of the QAJBACG4 file (or go into WRKOBJPDM and copy it):
CRTDUPOBJ OBJ(QAJBACG4) FROMLIB(QSYS) OBJTYPE(*FILE) TOLIB(mylib) NEWOBJ(myfile)
Then, fill it with accounting data (just the job accounting, type JB):
DSPJRN JRN(QACGJRN) ENTTYP(JB) OUTPUT(*OUTFILE) OUTFILE(mylib/myfile) OUTMBR(ACCOUNTREQ) OUTFILFMT(*TYPE4)
Note: If OUTFILFMT(*TYPE4) is not specified, you do not receive all of the required data.
Then, type STRQRY and select Option 1 (Work with queries). Create a query and give it a name (mylib/myaccqry).
Use mylib/myfile in the Specify file selection. Set up the fields you want in the Select and Sequence Fields section. At this point you have a lot of options for setting up the report you need. You can select different types of sorts, create your own columns (for example, you can create a Time On column that is JAACT/60000 to give the active time in minutes rather than milliseconds), select which records you want (only interactive jobs), and so on. The fields are described in table 15-3, 15-4, and 15-5 in the Work Management manual.
If you know Query, you can generate some simple reports. In the Converting Job Accounting Journal Entries section of the Job Accounting chapter in the OS/400 Work Management Manual, it says the fields for the accounting records are in files QSYS/QAJBACG and QSYS/QAPTACG. But it does not really say how to use them. Actually, files QSYS/QAJBACG4 and QSYS/QAPTACG4 should be used instead.
Note: For the rest of this document, we will work only with the job accounting records (JB type entries). It should work similarly for the spool records; however, they must be done separately.
First, create a database file to receive the accounting records from the journal. It is easiest to just create a duplicate of the QAJBACG4 file (or go into WRKOBJPDM and copy it):
CRTDUPOBJ OBJ(QAJBACG4) FROMLIB(QSYS) OBJTYPE(*FILE) TOLIB(mylib) NEWOBJ(myfile)
Then, fill it with accounting data (just the job accounting, type JB):
DSPJRN JRN(QACGJRN) ENTTYP(JB) OUTPUT(*OUTFILE) OUTFILE(mylib/myfile) OUTMBR(ACCOUNTREQ) OUTFILFMT(*TYPE4)
Note: If OUTFILFMT(*TYPE4) is not specified, you do not receive all of the required data.
Then, type STRQRY and select Option 1 (Work with queries). Create a query and give it a name (mylib/myaccqry).
Use mylib/myfile in the Specify file selection. Set up the fields you want in the Select and Sequence Fields section. At this point you have a lot of options for setting up the report you need. You can select different types of sorts, create your own columns (for example, you can create a Time On column that is JAACT/60000 to give the active time in minutes rather than milliseconds), select which records you want (only interactive jobs), and so on. The fields are described in table 15-3, 15-4, and 15-5 in the Work Management manual.
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]
Historical Number
8074400
Was this topic helpful?
Document Information
Modified date:
17 November 2020
UID
nas8N1010210