CL Command Reference - ADDJOBJS
CL Command List > ADDJOBJS Reference
Description:
The Add Job using Job Scheduler (ADDJOBJS) command allows you to schedule batch jobs by adding an entry to the job schedule. Jobs can be a single job or a member of a group of jobs or an application. You can use this command to schedule a batch job to be submitted once, at a regular interval and so on, basedon the schedule code you specify. You can schedule jobs with user-defined calendars, holiday exception calendars and fiscal year calendars.
The job schedule entry contains all of the information needed to submit the job, including the commands to process, the job description and user profile under which the job is run, the job queue to which the job is submitted, the message queue to which messages are sent and so on.
At the date and time you specify or Advanced Job Scheduler calculates, 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 attached to an inactive 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 a user-defined job, which is specified for the Job (JOB) parameter of this command.
Restrictions:
. You must have use (*USE) authority to the job description and the user profile.
. You must have *USE and add (*ADD) authorities to the message queue.
. You must have read (*READ) authority to the job queue and to all libraries associated with the specified objects.
. You must have *USE authority to the *ADDJOB function.
Examples:
Example 1: Adding a Job
ADDJOBJS JOB(JOB01) TIME(1000)
This command adds a job to the job schedule. In this example, job JOB01 is being added to the job schedule and is scheduled to run at 10:00 a.m.. Note that the default schedule code for this job is *DAILY and the DAY parameter is *ALL.
Example 2: Adding a Job with a *CALENDAR schedule code
ADDJOBJS JOB(JOB02) SCDCDE(*CALENDAR) CAL(CAL)
TIME(1100) CMD(WRKACTJOB)
This command adds the job JOB02 to the job scheduler. The job is scheduled to run at 11:00 a.m. using an *CALENDAR schedule and a calendar called CAL. When the job runs it processes the WRKACTJOB command.