SCHEDULED_JOB_INFO view

The SCHEDULED_JOB_INFO view returns information that can also be seen through the Work with Job Schedule Entries (WRKJOBSCDE) command interface. Each job schedule entry contains the information to automatically submit a batch job once or at regularly scheduled intervals.

Authorization: No authority is required to access scheduled job rows, but some columns return NULL if you don't have the required authority. You must have *JOBCTL special authority or be the user profile listed in the SCHEDULED_BY column to see the data in all columns.

The following table describes the columns in the view. The schema is QSYS2.

Table 1. SCHEDULED_JOB_INFO view
Column Name System Column Name Data Type Description
SCHEDULED_JOB_ENTRY_NUMBER ENTRYNO INTEGER The number assigned to the job schedule entry when the entry is added to the job schedule.
SCHEDULED_JOB_NAME SCDJOBNAME VARCHAR(10) The name of the job schedule entry.

This is the simple job name portion of the fully qualified job name used when the job is submitted. It is also used to identify the job schedule entry through change, hold, release and remove functions.

SCHEDULED_DATE_VALUE SCDDATEV VARCHAR(14) Indicates the date on which the job is scheduled to be submitted.
SCHEDULED_DATE
The date in the SCHEDULED_DATE column is used
SCHEDULED_DAYS
The days in the SCHEDULED_DAYS column are used
*MONTHSTR
The first day of the month is used.
*MONTHEND
The last day of the month is used.
SCHEDULED_DATE SCDDATE DATE
Nullable
The date on which the job is scheduled to be submitted.

Contains the null value if the SCHEDULED_DATE_VALUE column is not SCHEDULED_DATE.

SCHEDULED_TIME SCDTIME TIME The time when the job is scheduled to be submitted on the scheduled date.
SCHEDULED_DAYS SCDDAYS VARCHAR(34)
Nullable
The days on which the job is submitted if a specific date is not specified.

The value is a comma separated string with any or all of the values: *MON *TUE *WED *THU *FRI *SAT *SUN. The single value of *ALL can be returned to represent all seven values.

Contains the null value if SCHEDULED_DATE_VALUE is not SCHEDULED_DAYS.

FREQUENCY FREQUENCY VARCHAR(8) How often the job is to be submitted.
*ONCE
The job is scheduled to be submitted a single time.
*WEEKLY
The job is scheduled to be submitted on the same day or days of each week at the scheduled time.
*MONTHLY
The job is scheduled to be submitted on the same day or days of each month at the scheduled time.
RELATIVE_DAYS_OF_MONTH RELDAYSMON VARCHAR(13)
Nullable
Specifies which occurrence during the month (for the days listed in the SCHEDULED_DAYS column) the job is scheduled to be run. The value is a comma separated string with up to five of the following values:
1
The job is scheduled for the first occurrence of the day or days (SCHEDULED_DAYS: *MON and *WED for example) of the month.
2
The job is scheduled for the second occurrence of the day or days of the month.
3
The job is scheduled for the third occurrence of the day or days of the month.
4
The job is scheduled for the fourth occurrence of the day or days of the month.
5
The job is scheduled for the fifth occurrence of the day or days of the month.
*LAST
The job is scheduled for the last occurrence of the day or days of the month.

Contains the null value if the FREQUENCY column does not have a value of MONTHLY or SCHEDULED_DAYS is null.

RECOVERY_ACTION RECOVERY VARCHAR(7) The recovery action taken when the system is powered down or in the restricted state at the time a job is scheduled to be submitted.
*SBMRLS
Submit a job to the job queue as a released job.
*SBMHLD
Submit a job to the job queue as a held job.
*NOSBM
Do not submit a job to the job queue.
NEXT_SUBMISSION_DATE NXTSUBDATE DATE
Nullable
The next date that the job scheduling process is scheduled to submit this job.

Contains the null value if the job is not scheduled to be submitted again.

STATUS STATUS VARCHAR(9) The status of the job schedule entry.
HELD
The entry is held. If an entry has a status of HELD at the scheduled date and time, a job is not submitted.
SAVED
The entry is defined with a frequency of ONCE and a save value of *YES at a time later than the scheduled date and time.
SCHEDULED
The entry is waiting until the scheduled date and time for a job to be submitted.
JOB_QUEUE_NAME JOBQ VARCHAR(10) The job queue to which the job is scheduled to be submitted. Can contain the special value of *JOBD, meaning that the job is submitted to the job queue specified in the job description listed in the JOB_DESCRIPTION_NAME and JOB_DESCRIPTION_LIBRARY_NAME columns.
JOB_QUEUE_LIBRARY_NAME JOBQLIB VARCHAR(10)
Nullable
The library containing the job queue.

Contains the null value if JOB_QUEUE_NAME is *JOBD

.
JOB_QUEUE_STATUS JOBQSTATUS VARCHAR(10)
Nullable
The status of the job queue.
HLD
The job queue is held, but not attached to an active subsystem.
HLD/SBS
The job queue is held and attached to an active subsystem.
LOCKED
The status of the job queue could not be determined because a lock could not be obtained on the job queue.
RLS
The job queue is released, but not attached to an active subsystem.
RLS/SBS
The job queue is released and attached to an active subsystem.

Contains the null value if JOB_QUEUE_NAME is *JOBD, if the job queue is not found or is damaged, or if the information is not available.

DATES_OMITTED OMITDATES VARCHAR(219)
Nullable
A comma separated string with up to 20 dates in *ISO format indicating dates when the job will not be scheduled to run.

Contains the null value if no dates were specified to omit or if the information is not available.

SCHEDULED_BY CREATEDBY VARCHAR(10) The user profile of the job which added the entry to the job schedule.
DESCRIPTION TEXT VARCHAR(50)
Nullable
The descriptive text for the job schedule entry.

Contains the null value if the job schedule entry has no description.

COMMAND_STRING COMMAND VARCHAR(512)
Nullable
The command that is run in the submitted job.

Contains the null value if the information is not available.

USER_PROFILE_FOR_SUBMITTED_JOB SBMJOBUSR VARCHAR(10)
Nullable
The user profile to be used when the job is submitted. Can contain the special value *JOBD to indicate that the user profile from the job description is used.

Contains the null value if the information is not available.

JOB_DESCRIPTION_NAME JOBD VARCHAR(10)
Nullable
The job description used when the job is submitted. Can contain the special value of *USRPRF to indicate that the job description specified in the user profile under which the submitted job runs is used.

Contains the null value if the information is not available.

JOB_DESCRIPTION_LIBRARY_NAME JOBDLIB VARCHAR(10)
Nullable
The library containing the job description.

Contains the null value if JOB_DESCRIPTION_NAME has a value of *USRPRF or if the information is not available.

MESSAGE_QUEUE_NAME MSGQ VARCHAR(10)
Nullable
The name of the message queue where the messages for this job schedule entry are sent. Can contain the special value *USRPRF to indicate that the message queue specified in the user profile under which the submitted job runs is used.

Contains the null value is no specific message queue is associated with this job schedule entry or if the information is not available.

MESSAGE_QUEUE_LIBRARY_NAME MSGQLIB VARCHAR(10)
Nullable
The library containing the message queue.

Contains the null value if MESSAGE_QUEUE_NAME is null, contains the special value of *USRPRF, or if the information is not available.

LAST_SUCCESSFUL_SUBMISSION_
  TIMESTAMP
SBMTIMSTMP TIMESTAMP(0)
Nullable
The timestamp when a batch job was last successfully submitted for the job schedule entry.

Contains the null value if the job schedule entry has not been used to submit a job.

LAST_SUCCESSFUL_SUBMISSION_JOB LASTSBMJOB VARCHAR(28)
Nullable
The qualified job name used when this scheduled job was last submitted.

Contains the null value if the scheduled job has never been submitted or if the information is not available.

LAST_ATTEMPTED_SUBMISSION_
  TIMESTAMP
ATTSBMTIM TIMESTAMP(0)
Nullable
The timestamp when this scheduled job was last submitted.

Contains the null value if the scheduled job has never been submitted or if the information is not available.

LAST_ATTEMPTED_SUBMISSION_STATUS SBMJOBSTS VARCHAR(68)
Nullable
The status from when this scheduled job was last submitted. Values are:
  • JOB SUCCESSFULLY SUBMITTED
  • LAST JOB SUBMISSION FAILED, CHECK THE JOB MESSAGE QUEUE FOR DETAILS
  • JOB NOT SUBMITTED DUE TO HELD STATUS
  • JOB SUBMITTED AFTER SCHEDULED TIME AS SPECIFIED BY RECOVERY ACTION
  • JOB NOT SUBMITTED AS SPECIFIED BY RECOVERY ACTION

Contains the null value if the scheduled job has never been submitted or if the information is not available.

KEEP_ENTRY KEEP VARCHAR(3)
Nullable
Whether the job schedule entry is kept or removed after the job has been submitted.
YES
The job schedule entry is kept.
NO
The job schedule entry is removed.

Contains the null value when the FREQUENCY column does not contain *ONCE or if the information is not available.

Example

Review the job scheduled entries which are no longer in effect, either because they were explicitly held or because they were scheduled to run a single time and the scheduled date and time has passed.
SELECT * FROM QSYS2.SCHEDULED_JOB_INFO WHERE STATUS IN ('HELD', 'SAVED')
  ORDER BY SCHEDULED_BY;