Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Add Job Schedule Entry (ADDJOBSCDE) command allows you to schedule batch jobs by adding an entry to the job schedule. You can use this command to schedule a batch job to be submitted once, or to schedule a batch job to be submitted at regular intervals.
The job schedule entry contains all of the information needed to submit the job, including the command the job runs, the job description and user profile under which the job is run, the job queue to which the job is submitted, and the message queue to which messages are sent.
At the date and time you specify on this command, the job is submitted to the specified job queue. This command does not guarantee that the job will begin running at the scheduled time, however. The job will not begin running if the job queue is held or not attached to an active subsystem, or if the maximum number of active jobs allowed to run in the subsystem or on the system at one time has been reached.
Each job schedule entry is identified by the job name specified for the JOB parameter of this command and an entry number assigned by the system when the entry is added. The message replacement text sent when an entry is added contains the entry number. If there is more than one entry with the same job name, you may need to specify the number when changing the entry using the Change Job Schedule Entry (CHGJOBSCDE) command, removing the entry using the Remove Job Schedule Entry (RMVJOBSCDE) command, or when holding or releasing the entry using the Hold Job Schedule Entry (HLDJOBSCDE) or Release Job Schedule Entry (RLSJOBSCDE) command. You can use the Work with Job Schedule Entries (WRKJOBSCDE) command to show or print entries.
More information is in the Work Management information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
JOB | Job name | Name, *JOBD | Required, Positional 1 |
CMD | Command to run | Command string | Required, Positional 2 |
FRQ | Frequency | *ONCE, *WEEKLY, *MONTHLY | Required, Positional 3 |
SCDDATE | Schedule date | Date, *CURRENT, *MONTHSTR, *MONTHEND, *NONE | Optional |
SCDDAY | Schedule day | Single values: *NONE, *ALL Other values (up to 7 repetitions): *MON, *TUE, *WED, *THU, *FRI, *SAT, *SUN |
Optional |
SCDTIME | Schedule time | Time, *CURRENT | Optional |
RELDAYMON | Relative day of month | Values (up to 5 repetitions): *LAST, 1, 2, 3, 4, 5 | Optional |
SAVE | Save | *NO, *YES | Optional |
OMITDATE | Omit date | Values (up to 20 repetitions): Date, *NONE | Optional |
RCYACN | Recovery action | *SBMRLS, *SBMHLD, *NOSBM | Optional |
JOBD | Job description | Single values: *USRPRF Other values: Qualified object name |
Optional |
Qualifier 1: Job description | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
JOBQ | Job queue | Single values: *JOBD Other values: Qualified object name |
Optional |
Qualifier 1: Job queue | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
USER | User | Name, *CURRENT, *JOBD | Optional |
MSGQ | Message queue | Single values: *USRPRF, *NONE Other values: Qualified object name |
Optional |
Qualifier 1: Message queue | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
TEXT | Text 'description' | Character value, *BLANK | Optional |
Top |
Specifies the name of the job schedule entry.
This is a required parameter.
Note: To avoid deleting, holding, or releasing entries created by IBM products when you are using generic names to delete, hold, or release your entries, do not add entries with job names beginning with the letter Q.
Top |
Specifies the command that runs in the submitted job. Because the command you specify is used for the request data, the value specified for the RQSDTA parameter in the job description is ignored. The command you specify is syntax-checked when the entry is added.
This is a required parameter.
Top |
Specifies how often the job is submitted.
This is a required parameter.
If you specify *MONTHLY and a month does not contain the day specified for the SCDDATE parameter, the job is not run that month. For example, if SCDDATE(01/31/2004) and FRQ(*MONTHLY) are specified, the job is submitted on 01/31, 03/31, 5/31, 7/31, 8/31, 10/31 and 12/31, but will not run in February, April, June, September, or November. To submit a job on the last day of every month, specify SCDDATE(*MONTHEND).
If you specify *MONTHLY and your system or your job is configured to use Julian date format, the job is submitted to run on the day of the month that it would run if the system or job did not use Julian date format.
Top |
Specifies the date on which the job is submitted.
If your system or your job is configured to use the Julian date format, *MONTHSTR and *MONTHEND are calculated as if the system or job did not use the Julian date format.
The SCDDATE and SCDDAY parameters are mutually exclusive.
Top |
Specifies the day of the week on which the job is submitted.
The SCDDATE and SCDDAY parameters are mutually exclusive.
If today is the day of the week specified for this parameter and the time specified for the SCDTIME parameter has not passed, the job is submitted today. Otherwise, the job is submitted on the next occurrence of the specified day. For example, if SCDDAY(*FRI) and SCDTIME(12:00:00) are specified, and you are adding this job schedule entry at 11:00 a.m. on a Friday, the job is submitted today. If you are adding the entry at 4:00 p.m. on a Friday, or at 11:00 a.m. on a Monday, the job is submitted the following Friday.
Single values
Other values (up to 7 repetitions)
Top |
Specifies the time on the scheduled date at which the job is submitted.
Note: Although the time can be specified to the second, the activity involved in submitting a job and the load on the system may affect the exact time at which the job is submitted.
Top |
Specifies the relative day of the month on which the job is submitted to run.
This parameter is valid only if a value is specified for the SCDDAY parameter and FRQ(*MONTHLY) is specified.
You can specify 5 values for this parameter.
Top |
Specifies whether the entry for a job that is submitted only once is kept after the job is submitted. This parameter is valid only if FRQ(*ONCE) is specified.
Top |
Specifies a maximum of 20 dates on which the job is not submitted. You can, for example, use this parameter to prevent recurring jobs from running on holidays. The date must be specified in the job date format.
Top |
Specifies the recovery action to be taken if the job cannot be submitted at the designated time because the system is powered down or in restricted state. The action specified for this parameter occurs at the next initial program load (IPL) or when the system comes out of restricted state.
Jobs submitted during IPL or when the system comes out of restricted state are submitted in the same order that they would have been had the jobs been submitted at the times specified in the job schedule entries. If multiple occurrences of a recurring job are missed, the job is submitted only once. The first missed occurrence of a recurring job is used to order the jobs. The next occurrence of the job is calculated from the current date.
Since the scheduler portion of IPL need not be complete for the IPL of the system to be complete, other jobs may start on the system before all of the jobs have been submitted.
This parameter does not apply:
Specifying *NOSBM affects only missed occurrences of the job. If the job schedule entry is a recurring job, future occurrences are not affected.
Top |
Specifies the qualified name of the job description used when submitting the job.
Single values
Qualifier 1: Job description
Qualifier 2: Library
Top |
Specifies the qualified name of the job queue on which this job is placed.
You must have authority to the queue to specify a name on this parameter. Authority to the queue cannot be received through program adoption.
Single values
Qualifier 1: Job queue
Qualifier 2: Library
Top |
Specifies the name of the user profile under which the job is submitted.
Top |
Specifies the qualified name of the message queue to which messages are sent.
Messages are sent when the job is submitted and when a submitted job has completed running. Messages indicating a serious error are sent to the QSYSOPR message queue regardless of the value specified for this parameter when:
Single values
Qualifier 1: Message queue
Qualifier 2: Library
Top |
Specifies text that briefly describes the job schedule entry.
Top |
Example 1: Scheduling a Weekly Job
ADDJOBSCDE JOB(CLEANUP) SCDDATE(*NONE) CMD(CALL PGM(CLNUPLIB/CLNUPPGM)) SCDDAY(*FRI) SCDTIME('23:00:00') FRQ(*WEEKLY) RCYACN(*NOSBM) JOBD(CLNUPLIB/CLNUPJOBD)
This command submits a job named CLEANUP every Friday at 11 p.m. The job uses job description CLNUPJOBD in library CLNUPLIB. If the system is powered down or is in the restricted state at 11 p.m. on Friday, the job is not submitted at IPL or when the system comes out of restricted state.
Example 2: Scheduling a Monthly Job
ADDJOBSCDE JOB(PAYROLLJOB) CMD(CALL PAYROLL) SCDDATE(*NONE) SCDDAY(*MON) SCDTIME('09:00:00') FRQ(*MONTHLY) RELDAYMON(1)
This command submits a job to run program PAYROLL at 9 a.m. on the first Monday of every month.
Example 3: Omitting Dates
ADDJOBSCDE JOB(MONTHEND) CMD(CALL INVENTORY) SCDDATE(*MONTHEND) SCDTIME('23:30:00') FRQ(*MONTHLY) OMITDATE('12/31/2003')
This command submits a job to run program INVENTORY at 11:30 p.m. on the last day of every month except December 31, 2003.
Example 4: Scheduling a Daily Job
ADDJOBSCDE JOB(*JOBD) CMD(CALL DAILYCLEAN) SCDDATE(*NONE) SCDDAY(*ALL) SCDTIME('18:00:00') FRQ(*WEEKLY) RCYACN(*NOSBM) USER(SOMEPGMER)
This command submits a job to run program DAILYCLEAN every day at 6 p.m. The job runs under user profile SOMEPGMER. If the system is powered down or is in the restricted state at 6 p.m., the job is not submitted at IPL or when the system comes out of restricted state.
Example 5: Scheduling a Weekly Job
ADDJOBSCDE JOB(*JOBD) CMD(CALL PGM1) SCDDATE('06/01/2003') FRQ(*WEEKLY) USER(PGMR1)
This command submits a job to run program PGM1 every week starting on June 1, 2003 at the current time. Because June 1 is a Saturday, the job is submitted every Saturday.
Example 6: Scheduling a Job to Run Twice a Month
ADDJOBSCDE JOB(*JOBD) CMD(CALL PGM2) SCDDATE(*NONE) SCDDAY(*MON *WED) FRQ(*MONTHLY) RELDAYMON(3) SCDTIME('23:30:00')
This command submits a job to run program PGM2 every third Monday and every third Wednesday at 11:30 p.m. The job is submitted this month if the third Monday and Wednesday have not passed when this entry is added. If, for example, yesterday was the third Monday, today is the third Tuesday, and tomorrow is the third Wednesday, the job is submitted tomorrow, and then not again until next month.
Example 7: Scheduling a Job to Run Twice a Month
ADDJOBSCDE JOB(*JOBD) CMD(CALL PGM3) SCDDATE(*NONE) SCDDAY(*MON) FRQ(*MONTHLY) RELDAYMON(1 3) SCDTIME('09:00:00') USER(PGMR3)
This command submits a job to run program PGM3 on the 1st and 3rd Monday of every month at 9:00 a.m. The job runs under user profile PGMR3.
Example 8: Scheduling a Job to Run Every Weekday
ADDJOBSCDE JOB(*JOBD) CMD(CALL PGM4) SCDDATE(*NONE) SCDDAY(*MON *TUE *WED *THU *FRI) SCDTIME('19:00:00') FRQ(*WEEKLY)
This command submits a job to run program PGM4 every weekday at 7 p.m.
Top |
*ESCAPE Messages
Top |