Examples: job schedule entry

This topic provides examples for using the Add Job Schedule Entry (ADDJOBSCDE) command.

Schedule a job monthly: This example shows how to submit a job to run program INVENTORY at 11:30 p.m. on the last day of every month except on New Year’s Eve.
ADDJOBSCDE JOB(MONTHEND) 
CMD(CALL INVENTORY) 
SCDDATE(*MONTHEND) 
SCDTIME('23:30:00') 
FRQ(*MONTHLY) 
OMITDATE('12/31/05')
Schedule a job daily: This example shows how to submit a job to run program DAILYCLEAN every day at 6:00 p.m. The job runs under the user profile SOMEPGMR. This job is not submitted if the system is down or is in restricted state at that time.
ADDJOBSCDE JOB(*JOBD) 
CMD(CALL DAILYCLEAN) 
SCDDAY(*ALL) 
SCDTIME('18:00:00') 
SCDDATE(*NONE) 
USER(SOMEPGMR) 
FRQ(*WEEKLY) 
RCYACN(*NOSBM)
Schedule a job weekly: This example shows how to submit a job to run program PGM1 every week starting on 12/17/05 at the current time. Because 12/17/05 is a Saturday, the job is submitted every Saturday, and it runs under the user profile
PGMR1. ADDJOBSCDE JOB(*JOBD) 
CMD(CALL PGM1) 
SCDDATE('12/17/05') 
FRQ(*WEEKLY) 
USER(PGMR1)
Schedule a job every third Monday and Wednesday: This example shows how to submit a job to run program PGM2 on the third Monday and the third Wednesday at 11:30 p.m. This job will be submitted on the next third Monday or third Wednesday at 11:30 p.m., depending on whether those days have passed already this month. If yesterday was the third Monday, today is the third Tuesday, and tomorrow is the third Wednesday, it will be submitted tomorrow, and then not again until next month.
ADDJOBSCDE JOB(*JOBD) 
CMD(CALL PGM2) 
SCDDAY(*MON *WED) FRQ(*MONTHLY) 
SCDDATE(*NONE) 
RELDAYMON(3) SCDTIME('23:30:00')
Schedule a job every first and third Monday: This example shows how to submit a job to run program PAYROLL on the first and third Monday of every month at 9:00 a.m. The job runs under user profile PAYROLLMGR.
ADDJOBSCDE JOB(PAYROLL)
CMD(CALL PAYROLL)
SCDDAY(*MON) FRQ(*MONTHLY)
SCDDATE(*NONE)
RELDAYMON(1 3) SCDTIME('09:00:00')
USER(PAYROLLMGR)
Schedule a job every weekday: This example shows how to submit a job to run PGM4 every weekday at 7:00 p.m.
ADDJOBSCDE JOB(*JOBD) 
CMD(CALL PGM4) 
SCDDAY(*MON *TUE *WED *THU *FRI) 
SCDDATE(*NONE) 
SCDTIME('19:00:00') FRQ(*WEEKLY)
Save a job schedule entry: This example shows how to submit a job once and save the entry.
ADDJOBSCDE JOB(*JOBD) 
CMD(CALL SAVED) 
FRQ(*ONCE) 
SAVE(*YES)