Creating and scheduling a job
Scheduled jobs can be a single job, a member of a job group or an application. You can schedule a batch job to be submitted every week, every month, at a regular interval, and so on, based on the schedule you specify. You can schedule jobs with user-defined calendars, holiday exception calendars, and fiscal year calendars.
The scheduled job definition contains all of the information that is 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.
To create and schedule a new scheduled job, follow these steps:
- Expand Work Management.
- Expand Advanced Job Scheduler.
- Select New Scheduled Job.
The following pages must be completed.
- General Page
- Enter the Job name in the Job name field. The maximum length for the name is 10 characters. All new jobs names must be unique.
- Enter a brief description of the new job. This field is optional.
- Select whether you want the job to be a scheduled job, non-scheduled job, or an alternate job. NOTE: If you decide to create a non-scheduled job, the Schedule page is omitted.
- Add commands to the command list:
- Select Add beside the Command box.
- Enter a command string. Select Prompt for assistance in entering a command.
- Add message identifiers that are associated with this command. When the job runs and an error message is issued matching one of the messages that are entered for the selected command, the job will log the error but continue processing with the next command in the list.
- Select OK to add the command.
- Enter the application that is associated with the new job in the space provided. You can select an application from a list of existing applications. For more information, see Creating and working with application controls and job controls.
- Enter the name of the report distribution list that the job uses when the job distributes spooled files to email addresses and user's output queues. The spooled files to distribute are generated by the scheduled job. You may select a report distribution list from existing lists.
- Schedule Page
- There are two ways to specify the schedule for a scheduled job. You can select a pre-defined schedule to be associated with the job or define the schedule within the job. Even if a pre-defined schedule is used you are required to enter the scheduled times. The job can be defined to run up to 10 times per scheduled day or you can schedule the job to run every so many minutes. To define the schedule within the job, continue with the following steps.
- To select specific dates for the schedule, select On selected dates under the Frequency parameter in the Dates to run box. To add specific dates, click the dates you want to include on the calendar. Up to 30 dates can be selected. All of the dates that are selected are summarized in the Details box. The date range of the calendar is automatically completed for you below the calendar.
- To select days of the week for the schedule, select Weekly under
the Frequency parameter in the Dates
to run box. There are two ways to select days of the week.
- You can select the day of the week to select that specific day of the week. For example, if you want all Mondays to be included for that month, select any Monday that is shown and all of the Mondays are then highlighted and added to the calendar.
- Alternatively, under the Details box, select the day of the week you want to add to the calendar.
- To select certain days of the month for the schedule, select Monthly under the Frequency parameter in the Dates to run box. Select and highlight the days of the month that you want to include in the calendar. The days are summarized in the Details box. For example, if you want the first day of every month to be included in your calendar, select the first of the current month. This day is carried over to every month. Day 1 of every month is displayed in the Details box. You can add up to 30 days. You can also specify if you want the first working day, last working day, first, second, third, fourth, fifth or last day of each month to be included on the schedule for the job.
- To select certain dates of each year for the schedule, select Yearly under the Frequency parameter in the Dates to run box. Select and highlight the specific dates that you want to include in the calendar. The date carries over to every year. The dates are summarized in the Details box. For example, if you select September 1, this date will be scheduled for every year. 09/01 every year is displayed in the Details box. You can add up to 30 dates.
- Batch Information Page
- Specify the information that is used when submitting a new scheduled job in batch.
- Notification Page
- The Notification page provides you with a
place to specify how to notify your users the status of a job. You
can choose to send a completion message to a message queue. You must
specify the message queue and library to which you want to send the
message. Click Browse to select the message
queue from a list of existing queues. With the use of email notification,
you can send a message regarding the successful or unsuccessful completion
of the job, if the job is submitted but does not start within a certain
time limit or if the job is waiting on an error message. You must
specify both the recipient of the message and the message itself.Note: Before you can send an email message, you must specify a mail server to use for notification. For more information, see Specifying a mail server to use for notification.
- Problem Recovery Page
- Enter the maximum time in minutes that the job can run. You can enter a number 1 - 9999. Specify the action that you want to take after the maximum run time expires. The job can be ended or the system operator notified that the maximum run time expires.
- Select Use alternate job if job fails if you decide that you want to use an alternate job if the current one fails. Alternate jobs are used with jobs that do not process successfully. When Advanced Job Scheduler detects an unsuccessful job completion, it checks to see if there is an alternate job that is associated with the unsuccessful job. If there is, Advanced Job Scheduler processes the alternate job. Jobs are not required to have alternate jobs.
- Enter 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 that is specified on the parameter occurs at the next IPL or when the Advanced Job Scheduler system becomes active. Jobs that are submitted after an IPL or when the system comes out of restricted state are submitted in the same order that they would be submitted if the jobs are submitted at the times that are 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 the job is calculated from the current date.
- Enter the reply that you want to assign to inquiry messages. You
can specify that no change is made in the way that predefined messages
are answered, that all inquiry messages require a reply, that a default
reply is issued, or that the system reply list is selected for a matching
reply as each predefined inquiry message is sent. Note: The product default when installed is to use the default reply.
- Advanced Job Scheduler allows for extensive message logging. Enter the message level in the Level box, or use the drop-down arrow to open a list of possible values.
- Enter the message severity in the Severity box, or use the drop-down arrow to open a list of possible values.
- Enter the message text in the Text box, or use the drop-down arrow to open a list of possible values.
- Local Data Area Page
- The Local Data Area (LDA) page allows you to change the stored LDA for this job and assign variables to specific positions of the LDA. The LDA values that are displayed here are the LDA values that the job will use when submitted from Advanced Job Scheduler.
- Documentation Page
- Specify any text documentation for the scheduled job. For example, specify information for restarting the job, who is responsible, or who to contact during failures.