Command reference / job

ADDJOBSCDE

Add Job Schedule Entry

Adds an entry to the job schedule. The job schedule (QUSRSYS/QDFTJOBSCD) has one entry for each job to be submitted on a recurring date and time. When the scheduled date and time arrives, the system submits the entry's command as a batch job to the entry's job queue, using the job description, user profile and message queue of the entry. The job name and the entry number identify the entry; several entries may share a job name.

Allowed environments: *ALL. Positional parameters: 2.

Restrictions

Parameters

JOB Job name

Specifies the name of the job schedule entry. The simple job name together with the entry number identifies the entry.

Type
*NAME
Required
Yes
Length
10
Case
Uppercase

Suggested / special values: *JOBD

*JOBD
The job name in the specified job description is used. If the job description has *NONE for its job name, the name of the job description is used.

CMD Command to run

Specifies the command the submitted job runs. The command is the request data of the submitted job, so the routing entry that starts the job must specify a CL command processing program (QCMD for the IBM-supplied routing entries). A command that runs a program directly, such as CALL PGM(MYLIB/NIGHTLY), is the usual choice.

Type
*CMDSTR
Required
Yes
Case
Uppercase

FRQ Frequency

Specifies how often the entry is submitted. *ONCE entries are submitted once and then discarded unless SAVE(*YES) is specified. *WEEKLY and *MONTHLY entries recur from their schedule date or on their schedule days.

Type
*CHAR
Required
Yes
Length
8
Case
Uppercase

Allowed values: *ONCE, *WEEKLY, *MONTHLY, *YEARLY

*ONCE
The entry is submitted once, at its schedule date and time.
*WEEKLY
The entry is submitted every week on its schedule day (or every seven days from its schedule date).
*MONTHLY
The entry is submitted every month on its schedule day or schedule date.

SCDDATE Schedule date

Specifies the date of the entry, used both as the first submission date and as the monthly anchor day of a *MONTHLY entry. SCDDATE and SCDDAY are alternatives: give SCDDAY(*NONE) when SCDDATE names a date or a *MONTHSTR/*MONTHEND value, and SCDDATE(*NONE) when SCDDAY names the days.

Type
*DATE
Required
No
Default
*CURRENT
Case
Uppercase

Suggested / special values: *CURRENT, *MONTHSTR, *MONTHEND, *NONE

*CURRENT
The current date is used.
*MONTHSTR
The first day of the month is used.
*MONTHEND
The last day of the month is used.
*NONE
No schedule date is used; the entry is submitted on the days named by SCDDAY.

SCDDAY Schedule day

Specifies the days of the week on which the entry is submitted. Up to seven values may be given. Give either SCDDAY or SCDDATE, not both.

Type
*CHAR
Required
No
Default
*NONE
Length
6
List limit
7
Case
Uppercase

Suggested / special values: *MON, *TUE, *WED, *THU, *FRI, *SAT, *SUN, *NONE, *ALL

*NONE
No schedule day is used; the entry is submitted on the date named by SCDDATE.
*ALL
The entry is submitted every day.
*MON
Monday.
*TUE
Tuesday.
*WED
Wednesday.
*THU
Thursday.
*FRI
Friday.
*SAT
Saturday.
*SUN
Sunday.

SCDTIME Schedule time

Specifies the time of day, in hours, minutes and seconds, at which the entry is submitted.

Type
*TIME
Required
No
Default
*CURRENT
Case
Uppercase

Suggested / special values: *CURRENT

*CURRENT
The current time of day is used.

SAVE Save entry after submission

For a *ONCE entry, specifies whether the entry stays in the job schedule after it is submitted. The parameter is ignored for recurring entries, which are never discarded.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
The entry is discarded after it is submitted.
*YES
The entry stays in the job schedule after it is submitted.

OMITDATE Omit date

Specifies up to 20 dates on which the entry is not submitted. An omitted occurrence is skipped: the next occurrence is submitted as usual.

Type
*DATE
Required
No
Default
*NONE
List limit
20
Case
Uppercase

Suggested / special values: *NONE

RCYACN Recovery action

Specifies what happens when the entry could not be submitted at its scheduled time, because the system was powered down, in the restricted state or busy at that time. Only one occurrence of a missed entry is submitted, however many occurrences were missed.

Type
*CHAR
Required
No
Default
*SBMRLS
Length
7
Case
Uppercase

Allowed values: *SBMRLS, *SBMHLD, *NOSBM

*SBMRLS
The job is submitted when the system can submit it, in released status.
*SBMHLD
The job is submitted in held status and stays on its job queue until it is released.
*NOSBM
The job is not submitted for the missed occurrence.

RELDAYMON Relative day of month

For a *MONTHLY entry scheduled with SCDDAY, specifies which occurrence of the named weekdays in the month is submitted.

Type
*CHAR
Required
No
Default
*NONE
Length
6
List limit
5
Case
Uppercase

Allowed values: *NONE, 1, 2, 3, 4, 5, *LAST

*NONE
Every occurrence of the named days of the week is submitted.
*LAST
The last occurrence of the named days of the week in the month is submitted.

JOBD Job description

Specifies the job description used by the submitted job. It can be given as a qualified name or as a special value.

Type
*QUAL
Required
No
Default
*USRPRF
Case
Uppercase

Suggested / special values: *USRPRF

*USRPRF
The job description named in the user profile of the job is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Job description Job description

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

JOBQ Job queue

Specifies the job queue to which the entry is submitted. It can be given as a qualified name or as a special value.

Type
*QUAL
Required
No
Default
*JOBD
Case
Uppercase

Suggested / special values: *JOBD

*JOBD
The job queue named in the job description of the entry is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Job queue Job queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

USER User

Specifies the user profile under which the submitted job runs.

Type
*NAME
Required
No
Default
*CURRENT
Length
10
Case
Uppercase

Suggested / special values: *CURRENT, *JOBD

*CURRENT
The user profile of the job that adds the entry is used.
*JOBD
The user profile named in the job description of the entry is used.

MSGQ Message queue

Specifies the message queue to which the submitted job sends its completion and error messages. It can be given as a qualified name or as a special value.

Type
*QUAL
Required
No
Default
*USRPRF
Case
Uppercase

Suggested / special values: *USRPRF, *NONE

*USRPRF
The message queue named in the user profile of the job is used.
*NONE
The job does not send completion messages; error messages go to QSYSOPR.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Message queue Message queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

TEXT Text 'description'

Specifies the text description of the entry, up to 50 characters.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Mixed case

Suggested / special values: *BLANK

*BLANK
No text is stored.

Examples

ADDJOBSCDE JOB(NIGHTLY) CMD(CALL PGM(APLIB/NIGHTLY)) FRQ(*WEEKLY) SCDDAY(*MON *TUE *WED *THU *FRI) SCDTIME(230000)

Submits a batch job called NIGHTLY to its job queue at 23:00 every weekday.

ADDJOBSCDE JOB(MONTHEND) CMD(CALL PGM(APLIB/CLOSE)) FRQ(*MONTHLY) SCDDATE(*MONTHEND) SCDTIME(200000) TEXT('Month-end close')

Runs the month-end close on the last day of every month.

IBM command documentation

Generated from os/cl/catalog/ADDJOBSCDE.json and os/cl/help/ADDJOBSCDE.json.