You can use the OUTFILE parameter on the Display Journal (DSPJRN) command to write the job accounting journal entries into a database file that you can process.
The OUTFILE parameter allows you to name a file or member. If the member exists, it is cleared before the records are written. If the member does not exist, it is added. If the file does not exist, a file is created using the record format QJORDJE. This format defines the standard heading fields for each journal entry, but the job accounting data is defined as a single large field.
To avoid having to process the accounting data as a single large field, two field reference files are supplied to help you in processing the job accounting journal entries. The file QSYS/QAJBACG4 contains the record format QWTJAJBE and is used for JB entries. File QSYS/QAPTACG5 contains record format QSPJAPTE and is used for DP or SP™ entries. The same format is used for all printer file entries regardless if the output is SP (spooled) or DP (nonspooled). The DP entry for directly printed files contains some fields that are not used; these fields contain blanks.
The following DDS defines a physical file for the DP or SP journal entries using the QAPTACG5 field reference file in QSYS. You can create the file (using the CRTPF command) with the same name (QAPTACG5) as the model file.R QWTJAJBE FORMAT(QSYS/QAJBACG4)
You can specify a key field in either physical file; however, in this example, a logical file is used for sequencing. If you create two physical files (one for JB and one for DP or SP) with the members of the same name, you can issue the following DSPJRN commands to convert the entries. Assume that you have created the physical files with the same names as the model files in your library YYYY.R QSPJAPTE FORMAT(QSYS/QAPTACG5)
You can control the use and selection criteria of the DSPJRN command so that you do not convert the same entries several times. For example, you can select all entries in a specific range of dates. You can convert all of the entries at a cutoff point for your job accounting analysis, for example, monthly. One or more journal receivers might have been used during the month. Note that each use of the DSPJRN command to the same member causes the member to be cleared before any new entries are added. Do not use the JOB parameter of the DSPJRN command as some entries are made for a job by a system job and will therefore not appear as you expect them to.DSPJRN JRN(QACGJRN) JRNCDE(A) ENTTYP(JB) OUTPUT(*OUTFILE) OUTFILE(YYYY/QAJBACG4) DSPJRN JRN(QACGJRN) JRNCDE(A) ENTTYP(SP DP) OUTPUT(*OUTFILE) OUTFILE(YYYY/QAPTACG5)
Allowing the Processing of Both Physical Files:
Processing Basic Job Accounting Record:R QWTJAJBE PFILE(YYYY/QAJBACG4) K JACDE R QSPJAPTE PFILE(YYYY/QAPTACG5) K JACDE
This logical file can be processed by the query utility or by a high-level language program. If an abnormal system ending occurs, the qualified job name in the first 30 bytes of the JARES field in the journal entry describe the system job that wrote the entry at the next IPL and not the job that used the resources. For this reason, any analysis done on the JB entries should use the JAJOB, JAUSER, and JANBR fields.R QWTJAJBE PFILE(YYYY/QAJBACG4) K JACDE K JAUSER