IBM i Job Scheduling: ADDJOBSCDE, WRKJOBSCDE, IBM Advanced Job Scheduler, Notifications, and Batch Automation in 2026

IBM i includes a base job scheduler that runs a command at a set time without any extra product. You define a job schedule entry with ADDJOBSCDE, manage it with WRKJOBSCDE and its sibling commands, and the system submits the job for you. Anything more demanding, such as job dependencies or named holiday calendars, belongs to the separately licensed Advanced Job Scheduler (AJS).

This guide covers the base scheduler’s real parameters, how to handle holidays and month-end, how to hold and release entries, how to monitor the schedule with SQL, and when to move to AJS.

How the Base Scheduler Works

A job schedule entry stores what to run (a CL command), when to run it (date, day, time, frequency), and how to run it (job description, job queue, user, message queue). At the scheduled time the system submits a batch job from those attributes to the job queue. You do not need to wrap the command in SBMJOB: the scheduler does the submission.

Entries survive an IPL. If the system is powered off at the scheduled time, the RCYACN parameter decides what happens at the next start (below).

Entries in QUSRSYS/QDFTJOBSCD are submitted by the system job QJOBSCD, which normally runs under the QSYSWRK subsystem. If scheduled jobs are not being submitted, check that this job is active with WRKACTJOB JOB(QJOBSCD), and confirm the subsystem and job queue the scheduled job uses are active and not held.

ADDJOBSCDE: Adding an Entry

The parameters you will use most:

ParameterValues
JOBName of the entry and of the submitted job
CMDThe command to run, up to 512 characters
FRQ*ONCE, *WEEKLY, *MONTHLY, *YEARLY
SCDDATEA date, *CURRENT, *MONTHSTR, *MONTHEND, *NONE
SCDDAY*NONE, *ALL, or any of *MON to *SUN
SCDTIMEA time (hhmm or hhmmss) or *CURRENT
OMITDATEUp to 20 dates the job must not run on, or *NONE
RELDAYMONWhich occurrence of a weekday in the month: 1 to 5 or *LAST
JOBD, JOBQ, USER, MSGQJob description, job queue, user profile and message queue for the submitted job
RCYACN*SBMRLS, *SBMHLD or *NOSBM
SAVE*NO or *YES, whether to keep a *ONCE entry after it runs

There is no *DAILY or minute-interval frequency: for every day, use FRQ(*WEEKLY) with SCDDAY(*ALL). For anything that must repeat many times a day, use one entry per time, a long-running job that waits, or AJS.

/* Weekdays at 22:00 */
ADDJOBSCDE JOB(ORDNIGHT) +
           CMD(CALL PGM(APPLIB/ORDNGTPRC)) +
           FRQ(*WEEKLY) SCDDAY(*MON *TUE *WED *THU *FRI) +
           SCDTIME('220000') +
           JOBD(APPLIB/APPJOBD) JOBQ(APPLIB/APPJOBQ) USER(APPUSER) +
           RCYACN(*NOSBM) +
           TEXT('Nightly order processing')

/* Last day of every month at 01:00 */
ADDJOBSCDE JOB(MTHSTMT) +
           CMD(CALL PGM(APPLIB/MTHSTMTPRC)) +
           FRQ(*MONTHLY) SCDDATE(*MONTHEND) SCDTIME('010000') +
           TEXT('Monthly statements')

/* Every day at 23:30 */
ADDJOBSCDE JOB(DLYBACKUP) +
           CMD(CALL PGM(APPLIB/BAKPRC)) +
           FRQ(*WEEKLY) SCDDAY(*ALL) SCDTIME('233000') +
           JOBQ(QSYS/QSYSNOMAX) +
           TEXT('Daily backup job')

/* Once, on a specific date, and keep the entry afterwards */
ADDJOBSCDE JOB(DATAMIG) +
           CMD(CALL PGM(APPLIB/MIGPRC)) +
           FRQ(*ONCE) SCDDATE('2026-08-01') SCDTIME('020000') SAVE(*YES) +
           TEXT('One-time data migration')

A date written as a literal follows the job’s date format, so check yours before scheduling dates.

First Monday, last Friday

RELDAYMON places a weekday inside the month:

/* First Monday of each month */
ADDJOBSCDE JOB(MTHREVIEW) CMD(CALL PGM(APPLIB/REVIEWPRC)) +
           FRQ(*MONTHLY) SCDDAY(*MON) RELDAYMON(1) SCDTIME('080000') +
           TEXT('First Monday review')

Holidays and omitted dates

The base scheduler has no holiday calendar objects and no calendar parameters. To keep a job from running on particular days, list those dates in OMITDATE, up to 20 per entry:

ADDJOBSCDE JOB(PAYRUN) CMD(CALL PGM(PAYLIB/RUNPAYROLL)) +
           FRQ(*WEEKLY) SCDDAY(*FRI) SCDTIME('170000') +
           OMITDATE('2026-12-25' '2027-01-01') +
           TEXT('Weekly payroll, skipping listed dates')

An omitted date is skipped, not moved to the next day, and there is no “run the day before” option. For a rule such as “run the previous working day when Friday is a holiday”, a program that checks a holiday table (for example a Db2 table) is a better fit. If you manage many holidays across many jobs, that is the case for AJS, which supports holiday calendars.

A holiday guard in the scheduled program

When the rule is richer than a fixed list, schedule the job every day it could run and let the program decide. Keep the holidays in a Db2 table and have the CL program ask whether today is a holiday before it does any work:

CREATE TABLE APPLIB.BUSINESS_HOLIDAY (
  HOLIDAY_DATE DATE NOT NULL PRIMARY KEY,
  DESCRIPTION  VARCHAR(60) NOT NULL
);
**free
ctl-opt dftactgrp(*no) actgrp(*new) main(isHoliday);

dcl-proc isHoliday;
  dcl-pi *n;
    holidayFlag char(1);
  end-pi;
  dcl-s hits int(10);

  exec sql SELECT COUNT(*) INTO :hits
             FROM APPLIB.BUSINESS_HOLIDAY
            WHERE HOLIDAY_DATE = CURRENT DATE;
  holidayFlag = %char(hits > 0 : *ind);
end-proc;
PGM
DCL VAR(&HOLIDAY) TYPE(*CHAR) LEN(1)
CALL PGM(APPLIB/ISHOLIDAY) PARM(&HOLIDAY)
IF COND(&HOLIDAY *EQ '1') THEN(RETURN)
CALL PGM(APPLIB/RUNPAYROLL)
ENDPGM

The same table can drive “run on the previous working day” logic, because the program can look backwards for the last date that is not a holiday or weekend. The scheduler stays simple and the calendar lives in data that anyone can maintain.

Managing Entries

WRKJOBSCDE lists the entries, with options to change, hold, release, remove, display, work with the last submitted job, and submit the entry now. Its parameters let you filter by JOB, by the user who created it (SCDBY), and by job queue, and send output to a printer with OUTPUT(*PRINT). There is no DSPJOBSCDE command.

The matching commands change one entry from CL:

WRKJOBSCDE JOB(ORD*)

CHGJOBSCDE JOB(ORDNIGHT) ENTRYNBR(*ONLY) SCDTIME('210000')
HLDJOBSCDE JOB(ORDNIGHT) ENTRYNBR(*ONLY)
RLSJOBSCDE JOB(ORDNIGHT) ENTRYNBR(*ONLY)
RMVJOBSCDE JOB(DATAMIG) ENTRYNBR(*ONLY)

Two entries can share a name; ENTRYNBR identifies which one. There is no RTVJOBSCDE command; to read entry attributes from a program, use SQL (below).

Holding an entry stops it submitting until you release it. A held entry that nobody remembers is a classic cause of a “missing” batch job, so monitor for them.

What Happens When the System Was Off: RCYACN

RCYACN controls a schedule that was missed because the system was down or the scheduler was not running:

  • *SBMRLS submits the job when the system comes back, and releases it.
  • *SBMHLD submits the job on hold, so an operator can decide.
  • *NOSBM does not submit the job.

Choose per job. A nightly extract usually wants *NOSBM, while a month-end close may deserve *SBMHLD.

Monitoring the Schedule with SQL

The QSYS2.SCHEDULED_JOB_INFO view returns the schedule entries. Useful columns include SCHEDULED_JOB_NAME, STATUS (HELD, SAVED or SCHEDULED), FREQUENCY, SCHEDULED_DAYS, SCHEDULED_TIME, NEXT_SUBMISSION_DATE, RECOVERY_ACTION, DATES_OMITTED, COMMAND_STRING, LAST_SUCCESSFUL_SUBMISSION_TIMESTAMP and LAST_ATTEMPTED_SUBMISSION_STATUS.

-- Entries that are held, or one-time entries kept after they ran
SELECT SCHEDULED_JOB_NAME, STATUS, SCHEDULED_BY, DESCRIPTION
  FROM QSYS2.SCHEDULED_JOB_INFO
 WHERE STATUS IN ('HELD', 'SAVED')
 ORDER BY SCHEDULED_BY, SCHEDULED_JOB_NAME;

-- What runs next
SELECT SCHEDULED_JOB_NAME, FREQUENCY, SCHEDULED_DAYS, SCHEDULED_TIME,
       NEXT_SUBMISSION_DATE, COMMAND_STRING
  FROM QSYS2.SCHEDULED_JOB_INFO
 WHERE STATUS = 'SCHEDULED'
 ORDER BY NEXT_SUBMISSION_DATE, SCHEDULED_TIME;

-- The last attempt for each entry
SELECT SCHEDULED_JOB_NAME, LAST_SUCCESSFUL_SUBMISSION_TIMESTAMP,
       LAST_ATTEMPTED_SUBMISSION_STATUS
  FROM QSYS2.SCHEDULED_JOB_INFO
 ORDER BY SCHEDULED_JOB_NAME;

The view reports when the scheduler submitted a job, not whether the submitted job then succeeded. For that, use the job log, the job’s completion message, and your own notifications.

Failure Notification

The scheduler submits the job; what the job does when it fails is up to you. Send a message from inside the scheduled program:

PGM
DCL VAR(&ERRMSG) TYPE(*CHAR) LEN(100)
MONMSG MSGID(CPF0000 MCH0000) EXEC(GOTO CMDLBL(ERROR))

CALL PGM(APPLIB/ORDVALID)
CALL PGM(APPLIB/ORDBATCH)
SNDMSG MSG('ORDNIGHT completed') TOUSR(OPSNOTIFY)
RETURN

ERROR:
  RCVMSG MSGTYPE(*EXCP) MSG(&ERRMSG)
  SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
            MSGDTA('ORDNIGHT FAILED: ' *CAT &ERRMSG) +
            TOMSGQ(QSYSOPR) MSGTYPE(*INFO)
ENDPGM

Set MSGQ on the schedule entry so completion messages for the submitted job go to a queue that people watch. For the full pattern, see the CL error handling guides on this site.

When to Use the Advanced Job Scheduler

The Advanced Job Scheduler (AJS, product 5770-JS1) is a separately licensed product. It adds what the base scheduler lacks: job dependencies, named holiday and fiscal calendars, job groups, notification on late or failed jobs, and a job history log. Its commands (such as ADDJOBJS, CHGJOBJS, DSPJOBJS, WRKJOBJS and SETDEPJS) are different from the base commands, and its entries are managed separately, so decide up front which scheduler owns a job. Do not schedule the same work in both.

Stay with the base scheduler for simple, time-based work. Move to AJS when jobs must wait for each other, when holiday handling is shared across many jobs, or when you need central history and alerting. IBM’s Advanced Job Scheduler for i documentation lists the exact commands and parameters for your release.

Practical Rules

  • Name entries after the job and keep the TEXT clear; operators will search by it.
  • Put the scheduled work in a CL program and schedule CALL PGM(...), so changes do not require editing the entry.
  • Pick the job queue deliberately; backup jobs should not queue behind application work.
  • Decide RCYACN for every entry.
  • Review held and saved entries with the SQL above on a schedule of their own.
  • Document the owner and rerun procedure for each job.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top