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
- The user needs job control (*JOBCTL) special authority to add, change, remove, hold or release job schedule entries.
- The submitted job runs under the user profile named by the USER parameter; that profile needs use (*USE) authority to the job description, job queue and message queue of the entry, and to the command the entry runs.
Parameters
JOB
Job name
Specifies the name of the job schedule entry. The simple job name together with the entry number identifies the entry.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Library
Library
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.
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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
USER
User
Specifies the user profile under which the submitted job runs.
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.
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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
TEXT
Text 'description'
Specifies the text description of the entry, up to 50 characters.
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.
Generated from os/cl/catalog/ADDJOBSCDE.json and os/cl/help/ADDJOBSCDE.json.