Display Job Log (DSPJOBLOG)

The Display Job Log (DSPJOBLOG) command shows commands and related messages for a job that is still active when its job log has not been written. This command also shows commands for a job on a job queue that has not started processing.

This command is used to monitor the progress of a job.

Note: This function can also be accessed through the Display Job (DSPJOB) and Work with a Job (WRKJOB) commands.

Restrictions:

  1. To display a job log, you must have job control (*JOBCTL) special authority, or the job must have the same user name as the user running the DSPJOBLOG command.
  2. To display a job log for a job that has all object (*ALLOBJ) special authority, you must have *ALLOBJ special authority or be authorized to the All Object Job Log function of the IBM i through System i Navigator's Application Administration support. The Change Function Usage (CHGFCNUSG) command, with a function ID of QIBM_ACCESS_ALLOBJ_JOBLOG, can also be used to change the list of users that are allowed to display a job log of a job with *ALLOBJ special authority.

Parameters

Keyword Description Choices Notes
JOB Job name Single values: *
Other values: Qualified job name
Optional, Positional 1
Qualifier 1: Job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
OUTPUT Output *, *PRINT, *APIDFN, *OUTFILE Optional, Positional 2
OUTFILE File to receive output Qualified object name Optional
Qualifier 1: File to receive output Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OUTMBR Output member options Element list Optional
Element 1: Member to receive output Name, *FIRST
Element 2: Replace or add records *REPLACE, *ADD

Job name (JOB)

Specifies the name of the job whose job log is to be shown.

Single values

*
The job whose job log is to be shown is the job in which this command is issued.

Other values

qualified-job-name
Specify the job whose job log is to be shown. If no job qualifier is given, all jobs currently in the system are searched for the simple job name. If duplicates of the specified name are found, a list of messages containing the qualified job names of all duplicate names is shown.

A job identifier is a special value or a qualified name with up to three elements. For example:

*
job-name
user-name/job-name
job-number/user-name/job-name

Output (OUTPUT)

Specifies whether the output from the command is displayed at the requesting work station, printed with the job's spooled output or directed to a database file.

*
The output is displayed (if requested by an interactive job) or printed with the job's spooled output (if requested by a batch job).
*PRINT
The output is printed with the job's spooled output.
*OUTFILE
The output is directed to the database file specified in the OUTFILE parameter. This option can only be used if the JOB parameter specifies the special value asterisk (*). Using this option only allows a primary output file to be produced.
*APIDFN
The output is directed to the database files which were previously prepared by running the QMHCTLJL API. *APIDFN can only be specified if JOB(*) was also specified. The OUTFILE and OUTMBR parameters are not used.

When this value is used, both a primary and secondary output file can be produced. Any message filtering specified on the API is applied to the messages before they are written to the database. The database format (QMHPFT) of the output file is the same as that used in the IBM-supplied database file QAMHJLPR.

File to receive output (OUTFILE)

Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.

Qualifier 1: File to receive output

name
Specify the name of the database file to which the command output is directed.

Qualifier 2: Library

*LIBL
The library list is used to locate the file. If the file is not found, one is created in the current library. If no current library exists, the file will be created in the QGPL library.
*CURLIB
The current library for the thread is used to locate the file. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library to be searched.

Output member options (OUTMBR)

Specifies the name of the database file member that receives the output of the command.

Element 1: Member to receive output

*FIRST
The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter. If the member already exists, you have the option to add new records to the end of the existing member or clear the member and then add the new records.
name
Specify the name of the file member that receives the output. If it does not exist, the system creates it.

Element 2: Replace or add records

*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.

Examples

DSPJOBLOG   JOB(ANDERSON/PAYROLL)  OUTPUT(*PRINT)

This command produces a job log for job PAYROLL for user ANDERSON.

Error messages

*ESCAPE Messages

CPF0941
Job &3/&2/&1 no longer in system.
CPF1069
End of duplicate names.
CPF1070
Job &3/&2/&1 not found.
CPF24DB
The *APIDFN option requires that the QMHCTLJL API be run first.
CPF24D7
File &1 in library &2 cannot be used for job log production.
CPF24D8
DDM file &1 in library &2 cannot be used for job log production.
CPF24E0
Failure occurred while writing job log to file &1 in library &2.
CPF2441
Not authorized to display job log.
CPF2443
Job log not displayed or listed because job has ended.
CPF2523
No job log information.
CPF2532
Job message queue is damaged. Job log ended.
CPF9822
Not authorized to file &1 in library &2.
CPF9845
Error occurred while opening file &1.
CPF9846
Error while processing file &1 in library &2.
CPF9847
Error occurred while closing file &1 in library &2.