Monday, March 17, 2008

What determines when a job log will be created?

Every job that runs on your server has an associated job log that records its activities. A job log can contain the following:
· The commands in the job
· The commands in a control language (CL) program
· All messages associated with that job
There are several ways within OS/400 to specify the creation of or restrict the creation of a job log.
The message logging parameters on the job description and for an active job determine what kind of information will be collected:
Message logging: LOG
Level . . . . . . . . . . . . 4
Severity . . . . . . . . . . . 00
Text . . . . . . . . . . . . . *NOLIST
Log CL program commands . . . . LOGCLPGM *NO
If the message logging 'TEXT' parameter is set to *NOLIST, a job log will be created only if the job ends abnormally. If the job completes normally, no job log will be created. This is the same whether the job is an interactive or batch job.
If any value other than *NOLIST is specified for the message logging 'TEXT' parameter in a batch job, a job log will always be produced -- whether the job ends normally or abnormally.
This works differently for interactive jobs, though. To conserve disk space consumed by job logs, the SIGNOFF command may be defined as


Sign Off (SIGNOFF)

Type choices, press Enter.

Job log . . . . . . . . . . . . LOG *NOLIST
Drop line . . . . . . . . . . . DROP *DEVD
End connection . . . . . . . . . ENDCNN *NO

So, by default, when an interactive job is ended normally, no job log will be produced as specified by the LOG(*NOLIST) parameter. However, if an interactive job ends abnormally, a job log will be produced.
This job log is usually stored in the QEZJOBLOG output queue in library QUSRSYS. You can determine where your job log output goes with this command:
DSPFD FILE(QPJOBLOG)
Scroll down to the Spooling Description section of the Display File Description listing to see which output queue job log output will be directed to:
Spooling Description
Spooled output queue . . . . . . . . . . . : OUTQ QEZJOBLOG
Library . . . . . . . . . . . . . . . . . : QUSRSYS
If you want to always force the creation of a job log from an interactive job, you can do it in one of two ways:
1. When you sign off enter SIGNOFF LOG(*LIST) instead of using the default.
2. Prior to signing off enter DSPJOBLOG OUTPUT(*PRINT).
When one of those options is used, a job log will always be created from an interactive job.
Now that you understand how job logs are created on the iSeries, let's look at how to view one?
To view a job log that has already been created, use one of the following commands:
DSPSPLF FILE(QPJOBLOG) JOB(job_number/Usrid/Job_name)

DSPJOB JOB(job_number/Usrid/Job_name) OPTION(*SPLF)
To see ALL job log output on the system, use this command:
WRKOUTQ OUTQ(QUSRSYS/QEZJOBLOG)

No comments: