Change Job Schedule Entry (CHGJOBSCDE)

The Change Job Schedule Entry (CHGJOBSCDE) command allows you to change an entry in the job schedule.

The job schedule entry contains all of the information needed to automatically submit a batch job. You can use this command to change:

Each job schedule entry is identified by the job name, which is specified for the JOB parameter of this command, and an entry number, which is assigned by the system when the entry is added. 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 when holding or releasing the entry using the Hold Job Schedule Entry (HLDJOBSCDE) or Release Job Schedule Entry (RLSJOBSCDE) command. You can use the Work with Job Schedule Entries (WRKJOBSCDE) command to show or print entries.

More information is in the Work management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Restrictions:

  1. The issuer of this command must be running under a user profile which is the same as the job user identity of the job schedule entry being changed, or the issuer of the command must be running under a user profile which has job control (*JOBCTL) special authority.

    The job user identity is the name of the user profile by which a job is known to other jobs. More information about the job user identity is in the Work management topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

  2. To use this command, you must have:
    • use (*USE) authority to the command specified by the Command to run (CMD) parameter and execute (*EXECUTE) authority to the library containing that command.
    • use (*USE) authority to the job description (JOBD) and execute (*EXECUTE) authority to the library containing that job description.
    • use (*USE) authority to the job queue (JOBQ) and execute (*EXECUTE) authority to the library containing that job queue. Authority to the job queue cannot come from adopted authority.
    • use (*USE) authority to the user profile (USER) that the job is to run under.
    • use (*USE) and add (*ADD) authority to the message queue (MSGQ), and execute (*EXECUTE) authority to the library containing that message queue. Authority to the message queue cannot come from adopted authority.
    • change (*CHANGE) authority to object QDFTJOBSCD, type *JOBSCD, in library QUSRSYS and execute (*EXECUTE) authority to library QUSRSYS.

Parameters

Keyword Description Choices Notes
JOB Job name Name Required, Key, Positional 1
ENTRYNBR Entry number 000001-999999, *ONLY Optional, Key
CMD Command to run Command string Optional
FRQ Frequency *SAME, *ONCE, *WEEKLY, *MONTHLY Optional
SCDDATE Schedule date Date, *SAME, *CURRENT, *MONTHSTR, *MONTHEND, *NONE Optional
SCDDAY Schedule day Single values: *SAME, *NONE, *ALL
Other values (up to 7 repetitions): *MON, *TUE, *WED, *THU, *FRI, *SAT, *SUN
Optional
SCDTIME Schedule time Time, *SAME, *CURRENT Optional
RELDAYMON Relative day of month Single values: *SAME
Other values (up to 5 repetitions): *LAST, 1, 2, 3, 4, 5
Optional
SAVE Save *SAME, *NO, *YES Optional
OMITDATE Omit date Single values: *SAME, *NONE
Other values (up to 20 repetitions): Date
Optional
RCYACN Recovery action *SAME, *SBMRLS, *SBMHLD, *NOSBM Optional
JOBD Job description Single values: *SAME, *USRPRF
Other values: Qualified object name
Optional
Qualifier 1: Job description Name
Qualifier 2: Library Name, *LIBL, *CURLIB
JOBQ Job queue Single values: *SAME, *JOBD
Other values: Qualified object name
Optional
Qualifier 1: Job queue Name
Qualifier 2: Library Name, *LIBL, *CURLIB
USER User Name, *SAME, *JOBD, *CURRENT Optional
MSGQ Message queue Single values: *SAME, *USRPRF, *NONE
Other values: Qualified object name
Optional
Qualifier 1: Message queue Name
Qualifier 2: Library Name, *LIBL, *CURLIB
TEXT Text 'description' Character value, *SAME, *BLANK Optional

Job name (JOB)

Specifies the name of the job schedule entry.

This is a required parameter.

name
Specify the name of the job schedule entry that you want to change.

Entry number (ENTRYNBR)

Specifies the number of the job schedule entry you want to change. The message 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
Only one entry in the job schedule has the job name specified for the JOB parameter. If *ONLY is specified and more than one entry has the specified job name, no entries are changed and an error message is sent.
000001-999999
Specify the number of the job schedule entry you want to change.

Command to run (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 for the RQSDTA parameter in the job description is ignored. The command you specify is syntax-checked when the entry is added.

command-string
Specify a maximum of 512 characters.

Frequency (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 day specified for the SCDDATE parameter, the job is not run that month. For example, if SCDDATE(01/31/93) 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.

Schedule date (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, *MONTHSTR and *MONTHEND are calculated as if the system or job did not use the Julian date format.

*SAME
The value does not change.
*CURRENT
The job is submitted on the current date.
*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 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 the time you specify on the SCDTIME 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 a job to be submitted. When SCDDATE(*NONE) is specified, a value other than *NONE must be specified for SCDDAY.
date
Specify the date in the job date format.

Schedule day (SCDDAY)

Specifies the day of the week on which the job is submitted.

The SCDDATE and SCDDAY parameters are mutually exclusive.

If today is the day of the week specified for this parameter and the time specified for 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:00 a.m. on a Monday, the job is submitted the following Friday.

Single values

*SAME
The value does not change.
*NONE
No day is specified for a job to be submitted. SCDDAY(*NONE) is not valid when SCDDATE(*NONE) is specified.
*ALL
The job is submitted every day.

Other values (up to 7 repetitions)

*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.

Schedule time (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 SCDTIME(*CURRENT) and SCDDATE(*CURRENT), the job is immediately submitted to the job queue specified.
time
Specify the time you want the job to be submitted. The time is specified in 24-hour format and can be specified with or without a time separator:
  • 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 to 23. Valid values for mm and ss range from 00 to 59.
  • With a time separator, specify a string of 5 or 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If this command is entered 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 will fail.

Relative day of month (RELDAYMON)

Specifies the relative day of the month on which the job is submitted to run.

This parameter is valid only if a value is specified for the SCDDAY parameter and FRQ(*MONTHLY) is specified.

*SAME
The value does not change.

Other values (up to 5 repetitions)

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 of the week the second time it occurs in the month.
3
The job is submitted on the specified day of the week the third time it occurs in the month.
4
The job is submitted on the specified day of the week the fourth time it occurs in the month.
5
The job is submitted on the specified day of the week the fifth time it occurs in the month.
*LAST
The job is submitted on the specified day of the week the last time it occurs in the month.

Save (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.

Omit date (OMITDATE)

Specifies a maximum of 20 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.

Single values

*SAME
The value does not change.
*NONE
There are no dates when a job is not submitted.

Other values (up to 20 repetitions)

date
Specify a date when a job is not submitted.

Recovery action (RCYACN)

Specifies 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 specified for this parameter occurs at the next 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 same order that they would have been had the jobs 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 jobs have been submitted.

This parameter does not apply:

*SAME
The value does not change.
*SBMRLS
The job is submitted in the released state (RLS).
*SBMHLD
The job is submitted in the held state (HLD).
*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.

Job description (JOBD)

Specifies the qualified name of the job description used when submitting the job.

Single values

*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 parameter specifies the user profile.

Qualifier 1: Job description

name
Specify the name of the job description.

Qualifier 2: Library

*LIBL
All libraries in the thread's library list are searched until a match is found.
*CURLIB
The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library where the job description is located.

Job queue (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 come from adopted authority.

Single values

*SAME
The value does not change.
*JOBD
The submitted job is placed on the job queue specified in the job description. The JOBD parameter specifies the job description.

Qualifier 1: Job queue

name
Specify the name of the job queue.

Qualifier 2: Library

*LIBL
All libraries in the thread's library list are searched until a match is found.
*CURLIB
The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library where the job queue is located.

User (USER)

Specifies the name of the user profile under which the job is submitted.

*SAME
The value does not change.
*CURRENT
The job is submitted under the user profile of the user that is changing the entry.
*JOBD
The user profile specified for the USER parameter of the job description is used. The JOBD parameter of this command specifies the job description. This value is not valid if USER(*RQD) is specified in the job description.
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.

Message queue (MSGQ)

Specifies the 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 for this parameter when:

Single values

*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 parameter specifies the user profile.
*NONE
Completion messages are not sent. Error messages are sent to the QSYSOPR message queue.

Qualifier 1: Message queue

name
Specify the name of the message queue.

Qualifier 2: Library

*LIBL
All libraries in the thread's library list are searched until a match is found.
*CURLIB
The current library for the thread is used to locate the object. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library where the message queue is located.

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The value does not change.
*BLANK
No text is specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.

Examples

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(121503)  SCDTIME(110000)

This command schedules a batch job to run program A at 11 a.m. on 12/15/03 and every week on that same day.

Error messages

*ESCAPE Messages

CPF1620
Job schedule entry &3 number &4 not changed.
CPF9872
Program or service program &1 in library &2 ended. Reason code &3.