How job logs are created
Release V5R4 brings job logs into the “on demand” world. The job logs are available when needed, but no work is done to produce job logs for which there is no need.
The LOG parameter has three elements: the message (or logging) level, the message severity, and the level of message text. Each of these elements have specific values that when combined determine the amount and type of information sent to the job log by the job.
For example, the *NOLIST value of the Text element causes no job log to be produced if the job ends normally. (The job log does not go into pending.) If the job ends abnormally (if the job end code is 20 or higher), a job log is produced. The messages that appear in the job log contain both the message text and the message help.
You can control what produces the job log. This is done with the LOGOUTPUT parameter. When a job completes, one of three actions occur that affects how the job log is created. The following are values of the LOGOUTPUT parameter:
The job log server produces the job log: (*JOBLOGSVR)
The job itself produces the job log: If the job cannot produce its own job log, the job log will be produced by a job log server. (*JOBEND)
The job log is not produced: The job log remains in pending until it is removed. (*PND)
Note: These values do not affect job logs that are produced when the message queue is full and the job message queue full action specifies *PRTWRAP. Messages in the job message queue are written to a spooled file, from which the job log can be printed, unless the Control Job Log Output (QMHCTLJL) API was used in the job to specify that the messages in the job log are to be written to a database file.
What controls the job log parameters?
When a job starts, it gets its LOGOUTPUT value from the job description. If the job description specifies *SYSVAL (the default for CRTJOBD), the job uses the job log output value that is specified in the Job log output (QLOGOUTPUT) system value. (While the shipped value for the Job log output (QLOGOUTPUT) system value is *JOBEND, the recommended value is *JOBLOGSVR.) After the job has established its LOGOUTPUT job attribute, any changes to the job description or system value do not affect the active job. Changes to the system value or to the job description take effect for jobs entering the system after the change.
You can use the Change Job (CHGJOB) command or API (QWTCHGJB) to change the LOGOUTPUT job attribute after it has already been set in the job. Changes to the job take effect immediately.
Regardless of the method that you choose, the options for handling job logs are the same. You can set the job to not produce a job log (*PND), have the job produce the job log (*JOBEND), or have the job log server produce the job log (*JOBLOGSVR).
For more information on this topic, see the following website…