CHGJOBSCDE (Change Job Schedule Entry)
CHGJOBSCDE Command syntax diagram
Purpose
The Change Job Schedule Entry (CHGJOBSCDE) command changes an entry in the job schedule.
The job schedule entry contains all of the information needed to automatically run a batch job. Use this command to change:
- The command the job runs
- The date and time at which a job is scheduled to run
- The recovery action the system takes if the job cannot be submitted at the scheduled time
- The job description and user profile under which the job is run
- The job queue on which the job is placed when it is submitted
- The message queue to which messages are sent
Each job schedule entry is identified by the job name, which is specified on the JOB parameter of this command, and an entry number, which is assigned by the system when the entry is added. The message replacement text for the message 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 this command, removing the entry using the Remove Job Schedule Entry (RMVJOBSCDE) command, or holding or releasing the entry using the Hold Job Schedule Entry (HLDJOBSCDE) or Release Job Schedule Entry (RLSJOBSCDE) command. Use the Work with Job Schedule Entries (WRKJOBSCDE) command to show or print entries.
More information is in the Work Management book.
Restrictions
- You must have *JOBCTL special authority to use this command; otherwise you can change only those entries that you added.
- The user must have use authority to the job description and the user profile.
- The user must have use and add authorities to the message queue.
- The user must have read authority to the job queue.
- The user must have execute authority to all libraries associated with the specified objects.
Required Parameters
- JOB
- Specifies the name of the job schedule entry.
Optional Parameters
- ENTRYNBR
- Specifies the number of the job schedule entry you want to change. The message replacement text for the message that is sent when an entry is successfully added contains the entry number. You can also determine the entry number by using the Work with Job Schedule Entries (WRKJOBSCDE) command. Press F11 from the Work with Job Schedule Entries display to show the entry numbers of the selected entries.
*ONLY: One entry in the job schedule has the job name specified on the JOB parameter. If *ONLY is specified and more than one entry has the specified job name, no entries are changed and a message is sent.
entry-number: Specify the number of the job schedule entry you want to change.
- CMD
- Specifies the command that runs in the submitted job. The IBM-supplied default routing program QCMD must be used when the job is started or the job will not run. Because the command you specify is used for the request data, the value specified on the RQSDTA parameter in the job description is ignored. The command you specify is syntax-checked when the entry is added.
You can specify a maximum of 512 characters. Use command prompting for the command you are specifying on this parameter if you are using command prompting for the CHGJOBSCDE command.
Note: If you do not specify a value on this parameter, the command that runs in the submitted batch job does not change.
- FRQ
- Specifies how often the job is submitted to run.
*SAME: The value does not change.
*ONCE: The job is submitted once.
*WEEKLY: The job is submitted on the same day or days of each week at the scheduled time.
*MONTHLY: The job is submitted on the same day or days of each month at the scheduled time.
If you specify *MONTHLY and a month does not contain the date specified on the SCDDATE parameter, the job is not run that month. For example, if SCDDATE(01/31/91) and FRQ(*MONTHLY) are specified, the job will run 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.
- SCDDATE
- Specifies the date on which the job is submitted to run.
If your system or your job is configured to use the Julian date format, the *MONTHSTR and *MONTHEND values are calculated as if the system or job did not use the Julian date format.
*SAME: The value does not change.
*CURRENT: The current date is used.
*MONTHSTR: The job is submitted on the first day of the month. If you specify *MONTHSTR, and if today is the first day of the month, and if the time you specify on the SCDTIME parameter has not passed, the job is submitted today. Otherwise, the job is submitted on the first day of the next month.
*MONTHEND: The job is submitted on the last day of the month. If you specify *MONTHEND, and if today is the last day of the month, and if the time you specify on the SCDTIME parameter has not passed, the job is submitted today. Otherwise, it is submitted on the last day of the next month.
*NONE: No date is specified for when a job should be submitted.
date: Specify the date in the job date format.
- SCDDAY
- Specifies the day of the week on which the job is submitted.
If today is the day of the week specified on this parameter and the time specified on 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 a.m. on a Monday, the job is submitted the following Friday.
*SAME: The value does not change.
*NONE: No day is specified for when a job should be submitted.
*ALL: The job is submitted every day.
*MON: The job is submitted on Monday.
*TUE: The job is submitted on Tuesday.
*WED: The job is submitted on Wednesday.
*THU: The job is submitted on Thursday.
*FRI: The job is submitted on Friday.
*SAT: The job is submitted on Saturday.
*SUN: The job is submitted on Sunday.
- SCDTIME
- Specifies the time on the scheduled date at which the job is submitted to run.
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. *SAME: The value does not change.
*CURRENT: The job is submitted at the current time. If you specify *CURRENT on this parameter and SCDDATE(*CURRENT), the job is immediately submitted to the job queue with a status of released (RLS).
time: Specify the time you want the job to start. The time is specified in 24-hour format with or without a time separator as follows:
- With a time separator, specify a string of 5 or 8 digits, where the time separator for the job separates the hours, minutes, and seconds. If you issue this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command fails.
- Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 through 23. Valid values for mm and ss range from 00 through 59.
- RELDAYMON
- Specifies the relative day of the month on which the job is submitted to run.
You can specify a value on this parameter only if the SCDDAY parameter and FRQ(*MONTHLY) are specified.
*SAME: The value does not change.
1: The job is submitted on the specified day of the week the first time it occurs in the month. For example, if you specify SCDDAY(*TUE), FRQ(*MONTHLY), and RELDAYMON(1), the job is submitted on the first Tuesday of every month.
2: The job is submitted on the specified day the second time it occurs in the month.
3: The job is submitted on the specified day the third time it occurs in the month.
4: The job is submitted on the specified day the fourth time it occurs in the month.
5: The format of this tape is FMT3570E. The data format is written on the tape volume with a 3570E device.
*LAST: The job is submitted on the specified day the last time it occurs in the month.
- OMITDATE
- Specifies a list of 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.
*SAME: The value does not change.
*NONE: No dates are specified when the job should not be submitted.
date: Specify the dates on which the job is not submitted.
- RCYACN
- Specifies the recovery action to be taken if the scheduled job cannot be submitted at the designated time because the system is powered down or in restricted state. The action specified on 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 order that they would have been had they 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 scheduled jobs have been submitted.
This parameter does not apply in the following instances:
- When a job is released after being held at the date and time it was to be submitted
- When the date and time at which a job is to be submitted passes because of changes to date and time system values
*SAME: The value does not change.
*SBMRLS: The job is submitted in the released (RLS) state.
*SBMHLD: The job is submitted in the held (HLD) state.
*NOSBM: The job is not submitted.
Specifying *NOSBM affects only missed occurrences of the job. If the job schedule entry is a recurring job, future occurrences are not affected.
- SAVE
- 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.
*SAME: The value does not change.
*NO: The entry is not kept after the job is submitted.
*YES: The entry is kept after the job is submitted. If you specify *YES, the job is submitted once. The job is not submitted again until the Change Job Schedule Entry (CHGJOBSCDE) command is used to specify a new date and time.
- JOBD
- Specifies the qualified name of the job description used when submitting the job.
*SAME: The value does not change.
*USRPRF: The job description specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.
The name of the job description can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
job-description-name: Specify the name of the job description.
- JOBQ
- 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.
*SAME: The value does not change.
*JOBD: The submitted job is placed on the job queue specified in the job description. The job description is specified on the JOBD parameter.
The name of the job queue can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
job-queue-name: Specify the name of the job queue.
- USER
- Specifies the name of the user profile under which the scheduled job is submitted.
*SAME: The value does not change.
*CURRENT: The user profile that is currently running is used.
*JOBD: The user profile specified on the USER parameter of the job description is used. The job description is specified on the JOBD parameter of this command. This value is not valid if USER(*RQD) is specified in the job description.
user-name: Specify the name of the user profile that is used. You must be authorized to the user profile. The user profile must be authorized to the job queue, job description, and message queue specified on this command.
- MSGQ
- 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 on this parameter when:
- The message queue specified on this parameter is damaged.
- MSGQ(*NONE) is specified.
- MSGQ(*USRPRF) and USER(*JOBD) are specified, and the job description specified on the JOBD parameter is changed to USER(*RQD) after the entry is added.
Note: When MSGQ(*USRPRF) is specified and the user profile contains a message queue name with *LIBL as its library, the results can be unpredictable. When the job is submitted, the library list from the system value object is used. *SAME: The value does not change.
*USRPRF: The message queue specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.
*NONE: Completion messages are not sent. Error messages are sent to the QSYSOPR message queue.
The name of the message queue can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
message-queue-name: Specify the name of the message queue to which messages are sent.
- TEXT
- Specifies the text that briefly describes the job schedule entry. More information is in Commonly used parameters.
*SAME: The value does not change.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Examples for CHGJOBSCDE
Example 1: Changing a Job Schedule Entry
CHGJOBSCDE JOB(BACKUP) ENTRYNBR(001584) JOBQ(QGPL/QBATCH)This command changes job schedule entry BACKUP number 001584 so that its jobs are submitted to job queue QBATCH in library QGPL.
Example 2: Changing a Job Schedule Entry
CHGJOBSCDE JOB(EXAMPLE) ENTRYNBR(*ONLY) CMD('CALL PGM(A)') FRQ(*WEEKLY) SCDDATE(121591) SCDTIME(110000)This command schedules a batch job to run program A at 11 a.m. on 12/15/91 and every week on that same day.
Error messages for CHGJOBSCDE
*ESCAPE Messages
- CPF1620
- Job schedule entry &3 number &4 not changed.