Work with Job Logs (WRKJOBLOG)

Where allowed to run: Interactive environments (*INTERACT *IPGM *IREXX *EXEC)
Threadsafe: No
Parameters
Examples
Error messages

The Work with Job Logs (WRKJOBLOG) command displays a list of job logs that match the specified selection criteria.

Usage notes:

Top

Parameters

Keyword Description Choices Notes
JOBLOGSTT Job log state Values (up to 2 repetitions): *PENDING, *SPOOLED Optional, Positional 1
PERIOD Time period Element list Optional
Element 1: Start time and date Element list
Element 1: Beginning time Time, *AVAIL
Element 2: Beginning date Date, *CURRENT, *BEGIN
Element 2: End time and date Element list
Element 1: Ending time Time, *AVAIL
Element 2: Ending date Date, *CURRENT, *END
JOB Job name Qualified job name Optional
Qualifier 1: Job name Generic name, name, *ALL
Qualifier 2: User Generic name, name, *ALL
Qualifier 3: Number 000000-999999, *ALL
Top

Job log state (JOBLOGSTT)

Specifies the state of the job log for selecting which job logs are shown. A maximum of two values can be specified for this parameter.

*PENDING
Job logs for all completed jobs that have a pending job log and that meet the other selection criteria are included in the list.
*SPOOLED
Job log spooled files that meet the other selection criteria are included in the list. This includes job logs that have been detached from the job.
Top

Time period (PERIOD)

Specifies the period of time for selecting which job logs are shown. For pending job logs and spooled job logs which are associated with a job, this is the completion time of the job. For spooled job logs that are detached from the job, this is the creation date and time of the QPJOBLOG spooled file. This parameter contains two element lists of two elements each. A value or *N must be specified for an element if a subsequent element value will be specified in order to maintain its position in the parameter value sequence.

Element 1: Start time and date

Element 1: Starting time

One of the following is used to specify the starting time at which or after which the job completed or the spooled file was created. Job logs for jobs that ended before the specified time and date are not shown. Detached job logs that were created before the specified time and date are not shown.

*AVAIL
Any job logs that are available for the specified starting date are shown.
start-time
Specify the starting time for the specified starting date. The time is specified in 24-hour format and can be specified with or without a time separator:
  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Hours, minutes, and seconds must each be exactly 2 digits. Use leading zeros if necessary. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.
  • With a time separator, specify a string of 5 or 8 digits and characters where the time separator specified for your job is used to separate the hours, minutes, and seconds. If you enter this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.

Element 2: Starting date

One of the following is used to specify the starting date on which or after which the job completed or the spooled file was created. Job logs for jobs that ended before the specified time and date are not shown. Detached job logs that were created before the specified time and date are not shown.

*CURRENT
The current day is used as the starting date.
*BEGIN
Any job logs that meet the other selection criteria are shown. When *BEGIN is specified for the starting date, a starting time value other than *AVAIL is ignored.
start-date
Specify the starting date with or without date separators. The date must be entered in the date format that this job uses, as specified in the date format job attribute. If date separators are used then they need to be the same as the date separator that this job uses, as specified in the date separator job attribute. If you enter this command from the command line, the starting date string must be enclosed in apostrophes if it contains separators. If a date separator other than the separator specified for your job is used, this command will fail.

Element 2: End time and date

Element 1: Ending time

One of the following is used to specify the ending time before which the job completed or the spooled file was created. Job logs for jobs that ended after the specified time and date are not shown. Detached job logs that were created after the specified time and date are not shown.

*AVAIL
Any job logs that are available for the specified ending date are shown.
end-time
Specify the ending time for the specified ending date. See start-time for the formats in which time can be entered.

Element 2: Ending date

One of the following is used to specify the ending date before which the job completed or the spooled file was created. Job logs for jobs that ended after the specified time and date are not shown. Detached job logs that were created after the specified time and date are not shown.

*CURRENT
The current day is used as the ending date.
*END
The last day on which jobs completed or spooled job logs were created is used as the end date. If *END is specified, an ending time value other than *AVAIL is ignored.
end-date
Specify the ending date with or without date separators. The date must be entered in the date format that this job uses, as specified in the date format job attribute. If date separators are used then they need to be the same as the date separator that this job uses, as specified in the date separator job attribute. If you enter this command from the command line, the ending date string must be enclosed in apostrophes if it contains separators. If a date separator other than the separator specified for your job is used, this command will fail.
Top

Job name (JOB)

Specifies the qualified job names of jobs whose job logs are to be included in the list.

Qualifier 1: Job name

*ALL
Job logs for all job names with the specified job user name and job number are included.
generic-name
Specify the generic name of the jobs whose job logs are to be included. A generic name is a character string of one or more characters followed by an asterisk (*). If a generic name is specified, all job logs for jobs with job names that have the same prefix as the generic name are included.
name
Specify the name of the job whose job logs are included.

Qualifier 2: User

*ALL
Job logs for all job user names with the specified job name and job number are included.
generic-name
Specify the generic user name of the jobs whose job logs are included. A generic name is a character string of one or more characters followed by an asterisk (*). If a generic name is specified, all job logs for jobs with user names that have the same prefix as the generic name are included.
name
Specify the user name of the job whose job logs are included.

Qualifier 3: Number

*ALL
Job logs for all job numbers with the specified job name and job user name are included.
000000-999999
Specify the job number of the job whose job logs are included.
Top

Examples

Example 1: Showing All Pending Job Logs

WRKJOBLOG

This command displays the Work with Job Logs panel, showing a list of all pending job logs for jobs that ended on today's date.

Example 2: Showing All Spooled Job Logs With a Generic Job

WRKJOBLOG   JOBLOGSTT(*SPOOLED) JOB(*ALL/*ALL/QPADEV*)

This command displays the Work with Job Logs panel, showing a list of all spooled job logs created on today's date for all jobs whose simple job name starts with 'QPADEV'.

Example 3: Showing All Pending and Spooled Job Logs For a Specified Period

WRKJOBLOG   JOBLOGSTT(*PENDING *SPOOLED)
            PERIOD((*AVAIL 11212005) (*AVAIL 11252005))

This command displays the Work with Job Logs panel, showing a list of all pending job logs for jobs that ended during the specified 5 day period, and all spooled job logs that were created during the specified 5 day period.

Top

Error messages

*ESCAPE Messages

CPF9871
Error occurred while processing.
Top