CHGJOB (Change Job)

CHGJOB Command syntax diagram

 

Purpose

The Change Job (CHGJOB) command changes some of the attributes of a job. With the exception of a change in job queue, the job can be in a job or output queue, or it can be active in a subsystem. The job queue can only be changed when the job is a batch job and is in a job queue. If the job is in the output queue, the only thing that can be changed is the OUTQ priority. With the exception of the class attributes, the new attributes remain in effect for the duration of the job unless they are changed by another CHGJOB command. The class attributes remain in effect until the routing step that is currently active ends. If no routing step is active when the changes are made, they apply to the next routing step that is started. If an attribute that no longer affects the job is changed, a message is sent to the user of the command. For example, if the job has already completed running, it is too late to change the OUTQ and JOBPTY parameters. If any output files are still on the output queue, however, changing the OUTPTY parameter changes their output priority.

 

Restrictions

  1. The command must be issued from within the job being changed, or the issuer of the command must be running under a user profile which is the same as the job user identity of the job 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. It is described in more detail in the Work Management book.

  2. Only a user with job control (*JOBCTL) special authority can change the RUNPTY, TIMESLICE, PURGE, or DFTWAIT values.

  3. To change JOBQ or OUTQ, the user changing the job must have authority to the new queue. This authority cannot come from program adoption. To change the OUTQ, authority to the old queue is needed.

  4. This command is conditionally threadsafe. Refer to "Considerations for Attribute Thread Safety" for additional information.

 

Optional Parameters

JOB
Specifies the qualified name of the job and consists of as many as three elements. For example:
job-name
user-name/job-name
job-number/user-name/job-name

*N may be used in place of the user-name element to maintain position in the sequence. More information is in Commonly used parameters.

*: This command is issued within the job whose attributes are changed.

job-name: Specify the name of the job whose attributes are being changed. If no job qualifier is given, all of the jobs currently in the system are searched for the simple job name. If duplicates of the specified name are found, a qualified job name must be specified.

user-name: Specify the name of the user of the job whose attributes are being changed.

job-number: Specify the number of the job whose attributes are being changed.

JOBQ
Specifies the qualified name of the job queue on which this job is placed.

*SAME: The value does not change.

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 qualified name of the job queue on which the submitted job is placed.

JOBPTY
Specifies the scheduling priority used for the job being changed. Valid values range from 0 through 9, where 0 is the highest priority and 9 is the lowest priority. More information is in Commonly used parameters.

*SAME: The value does not change.

scheduling-priority: Specify a value, ranging from 0 through 9, for the job's scheduling priority. If the job is currently on the job queue, its position on the queue in relation to other jobs may be changed. The scheduling priority specified cannot be higher than the priority specified in the user profile under which the job, in which this command is entered, is running.

OUTPTY
Specifies the priority that the job's spooled files have for producing output. Valid values range from 1 through 9, where highest priority is 1 and the lowest priority is 9. More information is in Commonly used parameters.

*SAME: The value does not change.

output-priority: Specify a value, ranging from 1 through 9, for the priority of the job's output files. The output priority specified cannot be higher than the priority specified in the user profile in which the job entering the command is running.

PRTTXT
Specifies up to 30 characters of text to be printed at the bottom of each page of output. More information is in Commonly used parameters.

*SAME: The value does not change.

*SYSVAL: The system value, QPRTTXT, is used.

*BLANK: Text is not specified.

'print-text': Specify the character string that is printed at the bottom of each page. Up to 30 characters can be entered (enclosed in apostrophes).

LOG
Specifies the message logging values used to determine the amount and type of information sent to the job log by this job. This parameter has three elements: the message (or logging) level, the message severity, and the level of message text. If no values are specified on this parameter, the values specified in the job description associated with this job are used.

Note: For an interactive job, the values specified for the LOG parameter on the Sign Off (SIGNOFF) command take precedence over those specified on the LOG parameter on the Change Job (CHGJOB) command.

Element 1: Message Level

The message level specifies the type of information that is logged.

*SAME: The value does not change.

message-level: Specify a value, ranging from 0 through 4, that specifies the message logging level used for the job's messages. For additional information on the message levels, refer to the message-level value on the LOG parameter of the Create Job Description (CRTJOBD) command description.

Element 2: Message Severity

The severity level that is used in conjunction with the logging level to determine which error messages are logged in the job log.

*SAME: The value does not change.

message-severity: Specify a value, ranging from 00 through 99, that is used in conjunction with the logging level to determine which error messages are logged in the job log. More information on message severity is in Commonly used parameters.

Element 3: Message Text Level

The level of message text that is written in the job log when a message is logged according to the logging level and logging severity.

*SAME: The value does not change.

*MSG: Only message text is written to the job's log.

*SECLVL: Both the message text and the message help (cause and recovery) of the error message are written to the job log.

*NOLIST: If the job ends normally, no job log is produced. If the job ends abnormally (if the job end code is 20 or higher), a job log is produced. The messages that appear in the job log contain both the message text and the message help.

LOGCLPGM
Specifies whether the commands that are run in a control language (CL) program are logged to the job log by way of the CL program's message queue. This parameter sets the status of the job's logging flag. If LOG(*JOB) value has been specified in the Create CL Program (CRTCLPGM) command, the flag set in the LOGCLPGM parameter is used. Other values for the LOG parameter override the LOGCLPGM parameter. The commands are logged in the same manner as requests are logged.

For more information on request logging, refer to the LOG parameter in the CRTCLPGM command description.

*SAME: The value does not change.

*YES: Commands that come later in a CL program, which are capable of being logged, are logged to the job log.

*NO: Commands that come later in a CL program are not logged to the job log.

INQMSGRPY
Specifies the way that inquiry messages, which occur as a result of running a job, are answered. The user can specify that no change is made in the way replies to inquiry messages are sent, that all inquiry messages require a reply by the receiver of the inquiry message, that a default reply be issued, or that the system reply list is checked for a matching reply list entry. The conditions to be met are listed in the system reply list entries; refer to the ADDRPYLE (Add Reply List Entry) command description for more information.

*SAME: The value does not change.

*RQD: A reply is required from the receiver of the inquiry messages that are sent during the running of this job.

*DFT: The default reply to the inquiry message is sent. If no default reply is specified in the message description of the inquiry message, the system default reply, *N, is used.

*SYSRPYL: The system reply list is checked to see whether there is an entry for inquiry messages issued during the running of this job. If a match occurs, the reply value in that entry is used. If no entry exists for that inquiry message, a reply is required.

BRKMSG
Specifies how break messages are handled for all message queues allocated in *BREAK or *NOTIFY mode for the job.

*SAME: The value does not change.

*NORMAL: Break message handling is determined by the message queue status. Messages from the Send Break Message (SNDBRKMSG) command are shown at work stations to which a user is signed on.

*NOTIFY: An audible alarm sounds to indicate the presence of a message. *NOTIFY is allowed only for interactive jobs. An alarm sounds if:

  • The job was previously in BRKMSG(*HOLD) and there are messages on the queue that caused the alarm to sound

  • Messages arrive from SNDBRKMSG, or messages arrive that exceed the severity of a message queue in *NOTIFY or *BREAK delivery mode; the messages are not shown

*HOLD: Break messages are not shown either for message queues in *BREAK delivery mode or for messages sent to a signed on work station through the SNDBRKMSG command. The alarm does not sound for messages sent to message queues in *NOTIFY delivery mode. The user break message handling program is not started.

STSMSG
Specifies whether status messages are shown on the display for this job.

*SAME: The value does not change.

*USRPRF: Status messages are shown or not shown as specified in the user profile under which this job was initially running.

*SYSVAL: The value in the QSTSMSG system value is used.

*NONE: Status messages are not shown on the display.

*NORMAL: Status messages are shown on the display. Text on the bottom line of the display is lost.

PRTDEV
Specifies the qualified name of the default printer device for this job. If OUTQ(*DEV) is specified, the file is placed on an output queue with the same name as the printer.

Note: This assumes the defaults are specified on the OUTQ parameter for the printer file, job description, user profile and workstation.

*SAME: The value does not change.

*USRPRF: The printer device name specified in the user profile under which this job was initially running is used.

*SYSVAL: The value specified in the system value QPRTDEV is used.

*WRKSTN: The output queue assigned to the user's work station is used.

The name of the printer device 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.

printer-device-name: Specify the name of the printer device used for this job.

OUTQ
Specifies the qualified name of the output queue used for spooled files that specify OUTQ(*JOB). This parameter applies only to printer files that have *JOB specified on the OUTQ parameter.

*SAME: The value does not change.

*USRPRF: The output queue specified in the user profile under which this job was initially running is used.

*DEV: The output queue specified on the PRTDEV parameter is used.

*WRKSTN: The output queue assigned to the user's work station is used.

The name of the output 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.

output-queue-name: Specify the name of the output queue.

DDMCNV
Specifies whether the connections using distributed data management (DDM) protocols remain active when they are not being used. The connections include APPC conversations, active TCP/IP conversations or OptiConnect connections. The DDM protocols are used in Distributed Relational Database Architecture (DRDA) applications, DDM applications, or DB2 Multisystem applications.

*SAME: The value does not change.

*KEEP: The system keeps DDM conversations open when there are no users, except when:

  • The routing step ends on the source system either at the job or when the job starts a reroute of the job.

  • There is an explicit request that conversations be dropped, using the Reclaim Distributed Data Management Conversation (RCLDDMCNV) command or the Reclaim Resources (RCLRSC) command.

  • There is a communications failure or internal systems failure.

  • A DRDA connection to an application server not running on the iSeries 400 ends.

*DROP: The system ends a DDM-allocated conversation when there are no users. Examples include when an application closes a DDM file, or when a DRDA application runs an SQL DISCONNECT statement.

Note: Regardless of the value of DDMCNV, the RCLDDMCNV and RCLRSC commands end a DDM conversation if there are no users.

SCDDATE
Specifies the date on which the submitted job becomes eligible 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 submitted job becomes eligible to run on the current date.

*MONTHSTR: The submitted job becomes eligible to run 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, job is eligible to run today. Otherwise, the job becomes eligible to run on the first day of the next month.

*MONTHEND: The submitted job becomes eligible to run 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, job is eligible to run today. Otherwise, the job becomes eligible to run on the last day of the next month.

*MON: The job becomes eligible to run on Monday.

*TUE: The job becomes eligible to run on Tuesday.

*WED: The job becomes eligible to run on Wednesday.

*THU: The job becomes eligible to run on Thursday.

*FRI: The job becomes eligible to run on Friday.

*SAT: The job becomes eligible to run on Saturday.

*SUN: The job becomes eligible to run on Sunday.

date: Specify a date in the job date format with or without separators.

SCDTIME
Specifies the time on the scheduled date at which the job becomes eligible 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 becomes eligible to run.

*SAME: The value does not change.

*CURRENT: The current time is used.

time: Specify a time in the system format with or without separators defined for the job.

DATE
Specifies the date that is assigned to the job. More information on possible date formats is in the CL Programming book.

*SAME: The value does not change.

job-date: Specify the job date for the job. If no job date is specified for a job, the system date is used as the default for any function requiring a job date. The date specified in this parameter overrides the system date for the running of the job only.

DATFMT
Specifies the date format used for the job.

*SAME: The value does not change.

*SYSVAL: The value specified in the system value QDATFMT is used.

*YMD: The date format used is year, month, and day.

*MDY: The date format used is month, day, and year.

*DMY: The date format used is day, month, year.

*JUL: The Julian date format is used.

DATSEP
Specifies the date separator used for the job.

*SAME: The value does not change.

*SYSVAL: The value specified in the system value QDATSEP is used.

*BLANK: A blank is used for the date separator.

'/': A slash (/) is used for the date separator.

'-': A dash (-) is used for the date separator.

'.': A period (.) is used for the date separator.

',': A comma (,) is used for the date separator.

TIMSEP
Specifies the time separator used for the job.

Note: On other CL commands, time can be specified with or without a time separator. If a time separator is used on another command, it must be the same as the time separator specified on this parameter. If a different time separator is used to specify time on another command, the command will fail.

*SAME: The time separator does not change.

*SYSVAL: The value specified in the system value QTIMSEP is used.

':': A colon (:) is used for the time separator.

',': A comma (,) is used for the time separator.

'.': A period (.) is used for the time separator.

*BLANK: A blank is used for the time separator.

SWS
Specifies the switch settings for a group of eight job switches used with the job. These switches can be set or tested in a CL program and used to control the flow of the program. For example, if a certain switch is on, another program can be called. The job switches may also be valid in other high-level language (HLL) programs. The only values that are valid for each 1-digit switch are 0 (off), 1 (on), or X. The X indicates that a switch value does not change.

*SAME: The value does not change.

switch-settings: Specify any combination (within quotation marks or not) of eight zeros, ones, or Xs to change the job switch settings. If a switch value does not change, enter an X in the position representing that switch.

RUNPTY
Specifies the run priority for the job. Run priority is a value, ranging from 1 (highest priority) through 99 (lowest priority), that represents the priority at which the job competes for the processing unit relative to other jobs that are active at the same time. This value represents the relative (not the absolute) importance of the job. For example, a job with a run priority of 25 is not twice as important as one with a run priority of 50. This value is the highest run priority allowed for any thread within the job. Individual threads within the job may have a lower priority. Changing the run priority of the job will affect the run priorities of all threads within the job. For example, the job is running at priority 10, thread A within the job is running at priority 10 and thread B within the job is running at priority 15. The priority of the job is changed to 20. The priority of thread A would then be adjusted to 20 and the priority of thread B would be adjusted to 25.

If the job consists of multiple routing steps, a change to this attribute during a routing step does not apply to subsequent routing steps.

*SAME: The value does not change.

run-priority: Specify the run priority, ranging from 1 through 99, that the job uses.

TIMESLICE
Specifies the maximum amount of processor time (in milliseconds) given to each thread in the job before other threads in this job and in other jobs are given the opportunity to run. The time slice establishes the amount of time needed by a thread in the job to accomplish a meaningful amount of processing. At the end of the time slice, the thread might be put in an inactive state so that other threads can become active in the storage pool.

If the job consists of multiple routing steps, a change to this attribute during a routing step does not apply to subsequent routing steps.

*SAME: The value does not change.

time-slice: Specify the amount of time (in milliseconds) that each thread in the job has to run when it is given processing time. Valid entries range from 1 through 9999999 (9 999 999 milliseconds or 9999.999 seconds).

Note: Although you can specify a value of less than 8, the system takes a minimum of 8 milliseconds to run a process. If you display a job's run attributes, the time slice value is never less than 8.

PURGE
Specifies whether the job is marked to be moved out of main storage and put into auxiliary storage at the end of a time slice or when entering a long wait, such as waiting for a work station user's response. This attribute is ignored when more than one thread is active within the job.

If the job consists of multiple routing steps, a change to this attribute during a routing step does not apply to subsequent routing steps.

*SAME: The value does not change.

*YES: The job is to be moved out of main storage and put into auxiliary storage. However, a job with multiple threads is never purged from main storage.

*NO: The job is not eligible to be moved out of main storage and put into auxiliary storage. However, when main storage is needed, pages belonging to a thread in this job may be moved to auxiliary storage. Then, when a thread in this job runs again, its pages are returned to main storage as they are needed.

DFTWAIT
Specifies the default maximum time (in seconds) that a thread in the job waits for a system instruction, such as a LOCK machine interface (MI) instruction, to acquire a resource. This default wait time is used when a wait time is not otherwise specified for a given situation. Normally, this is the amount of time the user is willing to wait for the system before the request is ended.

If the wait time for any instruction is exceeded, an error message can be either shown or automatically handled by a Monitor Message (MONMSG) command.

The wait time specified for this parameter is ignored for read operations to database files; to specify that attribute, use the WAITRCD parameter of the appropriate database command (create, change, or override) for a physical, logical, or database file command.

If the job consists of multiple routing steps, a change to this attribute during a routing step does not apply to subsequent routing steps.

*SAME: The value does not change.

*NOMAX: There is no maximum wait time.

seconds-to-wait: Specify a value, ranging from 1 through 9999999 seconds, for the maximum time that the system waits for the system instruction to acquire a resource.

DEVRCYACN
Specifies the work station device recovery action to use for the job when an input/output error is encountered on the *REQUESTER device (the device on which the user signed on the system) for interactive jobs.

Note: This parameter can be specified only for interactive jobs.

*SAME: The value does not change.

*SYSVAL: The system value, QDEVRCYACN, is used as the device recovery action for this job.

*MSG: The application program requesting the input/output operation receives an error message, which indicates that the input/output operation failed.

*DSCMSG: The job is automatically disconnected. After the job is reconnected, it receives an error message indicating that an input/output error has occurred and that the device has been recovered. Even though the device has been recovered, the contents of the display prior to the error must be shown again.

*DSCENDRQS: The job is automatically disconnected. After the job is reconnected, the End Request (ENDRQS) command is issued specifying the processor that made the previous request. If no request processor is available, the ENDRQS command fails, and the message issued when the *DSCMSG value is specified is signaled.

*ENDJOB: The job is ended with the *IMMED option, and a job log is produced for the job.

*ENDJOBNOLIST: The job is ended with the *IMMED option. No job log list is produced for the job.

TSEPOOL
Specifies whether threads in interactive jobs are moved to another main storage pool when the time slice end is reached. When a long wait occurs, the thread is moved back to the pool in which it was originally running. This may minimize the effect on the interactive response time of other interactive jobs. This parameter can be specified only for interactive jobs.

*SAME: The value does not change.

*SYSVAL: The value specified in the system value QTSEPOOL is used.

*NONE: A thread in the job is not moved to another main storage pool when it reaches the end of its time slice.

*BASE: A thread in the job is moved to the base pool when the time slice end is reached.

PRTKEYFMT
Specifies the information to be printed when the print key is pressed.

*SAME: The value does not change.

*SYSVAL: The value specified in the system value QPRTKEYFMT is used.

*PRTHDR: Header information is included with output from the print key.

*PRTBDR: Border information is included with output from the print key.

*PRTALL: Header and border information is included with output from the print key.

*NONE: Header and border information is not printed.

SRTSEQ
Specifies the sort sequence table to be used for string comparisons for this job.

*SAME: This value does not change.

*SYSVAL: The system value QSRTSEQ is used.

*USRPRF: The sort table specified in the user profile under which this job was initially running is used.

*HEX: A sort sequence table is not used. The hexadecimal values of the characters are used to determine the sort sequence.

*LANGIDUNQ: A unique-weight sort table is used.

*LANGIDSHR: A shared-weight sort table is used.

The name of the sort sequence table 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.

table-name: Specify the name of the sort sequence table to be used with this job.

LANGID
Specifies the language identifier to be associated with this job. The language identifier is used when *LANGIDUNQ or *LANGIDSHR is specified on the sort sequence prompt (SRTSEQ parameter). If the job CCSID is 65535, this parameter is also used to determine the value of the job default CCSID (DFTCCSID).

*SAME: The value does not change.

*SYSVAL: The system value QLANGID is used.

*USRPRF: The language ID specified in the user profile under which this job was initially running is used.

language-ID: Specify the language identifier to be used by the job.

CNTRYID
Specifies the country or region identifier to be used by the job.

*SAME: The value does not change.

*SYSVAL: The system value QCNTRYID is used.

*USRPRF: The country or region ID specified in the user profile under which this job was initially running is used.

country-or-region-ID: Specify the country or region identifier to be used by the job.

CCSID
Specifies the coded character set identifier (CCSID) used for the job.

A CCSID is a 16-bit number identifying a specific set of encoding scheme identifiers, character set identifiers, code page identifiers, and additional coding-related information that uniquely identifies the coded graphic representation used.

*SAME: The CCSID value does not change.

*SYSVAL: The value specified in the system value QCCSID is used.

*USRPRF: The CCSID specified in the user profile under which this job was initially running is used.

*HEX: The CCSID 65535 is used.

coded-character-set-identifier: Specify the CCSID. More information on valid CCSIDs is in the Globalization topic in the Information Center.

DUPJOBOPT
Specifies the action taken when duplicate jobs are found by this command.

*SELECT: The selection display is shown when duplicate jobs are found during an interactive session. For other types of sessions, a message is issued.

*MSG: A message is issued when duplicate jobs are found.

JOBMSGQFL
Specifies the action that should be taken when the job message queue is full.

*SAME: The job message queue full option does not change.

*SYSVAL: The value specified for the QJOBMSGQFL system value is used.

*NOWRAP: The message queue does not wrap when it is full. This action ends the job.

*WRAP: The message queue wraps to the start of the message queue when full and starts filling the message queue again.

*PRTWRAP: The message queue wraps the job message queue when full and prints the messages that are being overlaid because of wrapping.

DECFMT
Specifies the decimal format used for the job.

*SAME: The value does not change.

*SYSVAL: The value specified for the QDECFMT system value is used.

*BLANK: A period (.) is used for the decimal format, zero suppression

'J': A comma (,) is used for the decimal format, one leading zero

'I': A comma (,) is used for the decimal format, zero suppression

CHRIDCTL
Specifies the character identifier control used for the job. This attribute controls the type of CCSID conversion that occurs for display files, printer files and panel groups. The *CHRIDCTL special value must be specified on the CHRID command parameter on the create, change or override commands for display files, printer files and panel groups before this attribute will be used.

*SAME: The value does not change.

*SYSVAL: The value specified for the QCHRIDCTL system value will be used.

*USRPRF: The character identifier control specified in the user profile under which this job was initially running is used.

*DEVD: The *DEVD special value performs the same function as the *DEVD value on the CHRID command parameter for display files, printer files and panel groups.

*JOBCCSID: The *JOBCCSID special value performs the same function as the *JOBCCSID value on the CHRID command parameter for display files, printer files and panel groups.

SPLFACN
Specifies whether or not spooled files are accessed through job interfaces after the job ends. Keeping spooled files with jobs allows job commands such as Work with Submitted Jobs (WRKSBMJOB) to work with the spooled files even after the job has ended. Detaching spooled files from jobs reduces the use of system resources by allowing job structures to be recycled when the jobs end.

*SAME: The value does not change.

*SYSVAL: The value specified in the system value QSPLFACN is used.

*KEEP: When the job ends, the spooled files are kept with the job and the status of the job is updated to indicate that the job has completed.

*DETACH: When the job ends, the spooled files are detached from the job and the job is removed from the system. If the job has already ended, this change will immediately detach the spooled files from the job and remove the job from the system.>

Examples for CHGJOB

Example 1: Changing Message Logging Values

CHGJOB   JOB(123581/DEPT2/WS1)  LOG(2 40 *SECLVL)

This command changes the job WS1, which is associated with the user profile DEPT2, and has the job number 123581. It receives only commands and associated diagnostic messages (help text) if the messages have a severity level greater than or equal to 40. Help text, in addition to the message text, is logged in the job log.

Example 2: Changing Scheduling Priority and Job Switches

CHGJOB   JOB(PAYROLL)  JOBPTY(4)  OUTPTY(3)
  SWS(10XXXX00)

This command changes the scheduling priority for the job PAYROLL to 4 and the priority of the job's output to 3. Also, four of the eight job switches are changed: switches 1 and 2 are set to 1 and 0, switches 3 through 6 remain the same, and switches 7 and 8 are both set to 0. Because only the simple name of the job is specified, there can be only one job named PAYROLL in the system.

Example 3: Moving a Job to Another Queue

CHGJOB   JOB(MYJOB)  JOBQ(MYLIB/MYJOBQ)
  INQMSGRPY(*SYSRPYL)

This command moves the job from the job queue it is currently in to the job queue MYJOBQ in library MYLIB. For this change to be made, the job must not have begun running and must be a batch job. Also, the job is changed so that any inquiry message that is issued on behalf of this job that has an entry in the system automatic reply list is answered according to the reply in that system reply list entry. For any inquiry message not represented in the system reply list, a reply is required.

Example 4: Changing Run Priority and Default Wait Time

CHGJOB   JOB(MYJOB)  RUNPTY(10)  DFTWAIT(150)

This command changes the run priority of the job MYJOB to 10 and the default wait time to 150 seconds, if the issuer of the command has job control authority. If the job is active, these changes take effect immediately. If the job is on a job queue, when the next routing step for the job is started, the run priority and default wait times become these values and not what was specified in the class associated with the routing entry used to start the step.

Additional Considerations

Considerations for Attribute Thread Safety

This command is intended to be used to change the job attributes for the target job (either the job that the command is issued in or another job on the system). All attributes that are to be changed are scoped to the job.

The Threadsafecolumn of the following table indicates whether the attributes can be changed in a manner that is threadsafe.

Yes:
Attributes marked with this value are considered to be threadsafe. These attributes can be changed safely by issuing this command from either an initial thread or from a secondary thread. The target job may also be either single threaded or multi threaded.

No:
Attributes marked with this value are not threadsafe. An attempt to change these attributes will be denied if multiple threads are active in the job issuing this command or in the target job.

Table 1. Attribute and Thread Safety

Attribute Threadsafe
Break message handling (BRKMSG) Yes
Character identifier control (CHRIDCTL) Yes
Coded character set ID (CCSID) Yes
Country or region ID (CNTRYID) Yes
Date format (DATFMT) Yes
Date separator (DATSEP) Yes
DDM conversation (DDMCNV) No
Decimal format (DECFMT) Yes
Default wait time (DFTWAIT) Yes
Device recovery action (DEVRCYACN) Yes
Eligible for purge (PURGE) Yes
Inquiry message reply (INQMSGRPY) Yes
Job date (DATE) Yes
Job message queue full action (JOBMSGQFL) Yes
Job priority (on JOBQ) (JOBPTY) Yes
Job queue (JOBQ) Yes
Job switches (SWS) Yes
Language ID (LANGID) Yes
Log CL program commands (LOGCLPGM) Yes
Message logging (LOG) Yes
Output priority (on OUTQ) (OUTPTY) Yes
Output queue (OUTQ) Yes
Print key format (PRTKEYFMT) Yes
Print text (PRTTXT) Yes
Print device (PRTDEV) Yes
Run priority (RUNPTY) Yes
Schedule date (SCDDATE) No
Schedule time (SCDTIME) No
Sort sequence (SRTSEQ) Yes
Spooled file action (SPLFACN) Yes>
Status message (STSMSG) Yes
Time separator (TIMSEP) Yes
Time slice (TIMESLICE) Yes
Time slice end pool (TSEPOOL) Yes

Error messages for CHGJOB

*ESCAPE Messages

CPF1317
No response from subsystem for job &3/&2/&1.
CPF1321
Job &1 user &2 job number &3 not found.
CPF1332
End of duplicate job names.
CPF1334
Must be an interactive job for requested change.
CPF1336
Errors on CHGJOB command for job &3/&2/&1.
CPF1337
&3/&2/&1 not authorized to change parameters.
CPF1340
Job control function not performed.
CPF1341
Reader or writer &3/&2/&1 not allowed as job name.
CPF1343
Job &3/&2/&1 not valid job type for function.
CPF1344
Not authorized to control job &3/&2/&1.
CPF1351
Function check occurred in subsystem for job &3/&2/&1.
CPF1352
Function not done. &3/&2/&1 in transition condition.
CPF1634
Specified date or time has passed.
CPF1635
Requested change no longer allowed.
CPF1642
Schedule date &1 not correct.
CPF1644
Scheduled date and time not changed.
CPF1650
Both scheduled date and time must be changed.
CPF1651
Sort sequence table not accessed.
CPF180E
&4 not changed.
CPF1846
Request did not complete. System value not available.
CPF1854
Value &1 for CCSID not valid.