Command reference / job

CHGJOB

Change Job

Changes some attributes of a job. The job can be on a job queue, on an output queue, or active in a subsystem. Only batch jobs on a job queue can have their job queue changed. For a job on an output queue, only OUTPTY, LOGOUTPUT, and SPLFACN can be changed. Most new attributes stay in effect for the rest of the job unless another CHGJOB changes them. Class attributes stay in effect until the active routing step ends, or apply to the next routing step if none is active. Changing an attribute that no longer affects a finished job sends a message to the command issuer.

Allowed environments: *ALL. Positional parameters: 1.

Restrictions

Parameters

JOB Job name

Specifies the name of the job whose attributes are being changed. If no job qualifier is given, all jobs in the system are searched, and a qualified name is needed if more than one match exists.

Type
*QUAL
Required
No
Default
*
Case
Uppercase

Suggested / special values: *

*
The attributes of the job that issues this command are changed.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Job name Job name

Type
*NAME
Required
No
Length
10
Case
Uppercase

User User

Type
*NAME
Required
No
Length
10
Case
Uppercase

Number Number

Type
*CHAR
Required
No
Length
6
Case
Uppercase

JOBPTY Job priority (on JOBQ)

Specifies the scheduling priority for the job, from 0 (highest) to 9 (lowest). If the job is on the job queue, its position may change. It cannot be higher than the priority in the issuer's user profile.

Type
*INT4
Required
No
Default
*SAME
Range
0 to 9
Case
Uppercase

Suggested / special values: *SAME

*SAME
The scheduling priority does not change.

OUTPTY Output priority (on OUTQ)

Specifies the output priority for spooled files produced by this job, from 1 (highest) to 9 (lowest). It cannot be higher than the priority in the issuer's user profile. Only spooled files on output queues in the thread's library name space are changed.

Type
*INT4
Required
No
Default
*SAME
Range
1 to 9
Case
Uppercase

Suggested / special values: *SAME

*SAME
The job's output priority does not change.

PRTDEV Print device

Specifies the default printer device for this job. It assumes defaults are set on the printer file's OUTQ parameter, the job description, the user profile, and the workstation.

Type
*NAME
Required
No
Default
*SAME
Length
10
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *SYSVAL, *WRKSTN

*SAME
The default printer device does not change.
*USRPRF
The device comes from the user profile (the initial profile of this thread, or the current profile of another job).
*SYSVAL
The value in system value QPRTDEV is used.
*WRKSTN
The printer device assigned to the job's work station is used.

OUTQ Output queue

Specifies the output queue for spooled files that specify OUTQ(*JOB). It applies only to printer files with *JOB for the output queue.

Type
*QUAL
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *DEV, *WRKSTN

*SAME
The default output queue does not change.
*USRPRF
The output queue comes from the user profile (the initial profile of this thread, or the current profile of another job).
*DEV
The output queue is determined by the DEV parameter of the printer file (set by CRTPRTF, CHGPRTF, or OVRPRTF).
*WRKSTN
The output queue assigned to the job's work station is used.
*LIBL
All libraries in the thread's library list are searched until the first match is found.
*CURLIB
The thread's current library is used. If none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Output queue Output queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

RUNPTY Run priority

Specifies the run priority for the job, from 1 (highest) to 99 (lowest). It is the highest run priority allowed for any thread in the job. Changing it adjusts all thread priorities. It does not carry into later routing steps if changed during a routing step.

Type
*INT4
Required
No
Default
*SAME
Range
1 to 99
Case
Uppercase

Suggested / special values: *SAME

*SAME
The run priority does not change.

JOBQ Job queue

Specifies the job queue in which this job is placed.

Type
*QUAL
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME

*SAME
The job queue does not change.
*LIBL
All libraries in the thread's library list are searched until the first match is found.
*CURLIB
The thread's current library is used. If none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Job queue Job queue

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

PRTTXT Print text

Specifies the text printed at the bottom of each page of printed output and on separator pages. Up to 30 characters, enclosed in apostrophes.

Type
*CHAR
Required
No
Default
*SAME
Length
30
Case
Uppercase

Suggested / special values: *SAME, *SYSVAL, *BLANK

*SAME
The value does not change.
*SYSVAL
The value in system value QPRTTXT is used.
*BLANK
No text is printed.

LOG Message logging

Specifies the message logging values that control the amount and type of information sent to the job log. It has three elements: logging level (0-4), severity (0-99), and message text level. If no values are given, the values do not change.

Type
*ELEM
Required
No
Case
Uppercase
*SAME
The value does not change (applies to each element).
*MSG
Only the message text is written to the job log.
*SECLVL
Both the message text and the message help are written to the job log.
*NOLIST
No job log is produced if the job ends normally. If it ends abnormally (end code 20 or higher), a job log is produced.
Elements in order

Level Level

Type
*INT4
Required
No
Default
*SAME
Range
0 to 4
Case
Uppercase

Suggested / special values: *SAME

Severity Severity

Type
*INT4
Required
No
Default
*SAME
Range
0 to 99
Case
Uppercase

Suggested / special values: *SAME

Text Text

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *MSG, *SECLVL, *NOLIST

LOGCLPGM Log CL program commands

Specifies whether commands in a CL program are logged to the job log through the CL program's message queue. It sets the job's logging flag. If *JOB was specified on CRTCLPGM's LOG parameter, this flag is used; other LOG values override it.

Type
*CHAR
Required
No
Default
*SAME
Length
5
Case
Uppercase

Allowed values: *SAME, *NO, *YES

*SAME
The state of the logging flag does not change.
*NO
Commands that come later in a CL program are not logged.
*YES
Commands that come later in a CL program and can be logged are logged.

LOGOUTPUT Job log output

Specifies how the job log is produced when the job completes. Messages are written to a spooled file unless the Control Job Log Output (QMHCTLJL) API directed them to a database file. It can be changed until the job log is produced or removed.

Type
*CHAR
Required
No
Default
*SAME
Length
10
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *JOBLOGSVR, *JOBEND, *PND

*SAME
The value does not change.
*SYSVAL
The value in system value QLOGOUTPUT is used.
*JOBLOGSVR
A job log server produces the job log.
*JOBEND
The job produces its own job log, or a job log server does if the job cannot.
*PND
No job log is produced; it stays pending until removed.

JOBMSGQFL Job message queue full action

Specifies the action taken when the job message queue is full.

Type
*CHAR
Required
No
Default
*SAME
Length
8
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *NOWRAP, *WRAP, *PRTWRAP

*SAME
The option does not change.
*SYSVAL
The value in system value QJOBMSGQFL is used.
*NOWRAP
The queue does not wrap when full, and this action ends the job.
*WRAP
The queue wraps to the start and continues filling.
*PRTWRAP
The queue wraps and prints the messages that are overwritten.

INQMSGRPY Inquiry message reply

Specifies how predefined inquiry messages sent while this job runs are answered. Replies can be required, use the message's default, or be checked against the system reply list.

Type
*CHAR
Required
No
Default
*SAME
Length
8
Case
Uppercase

Allowed values: *SAME, *RQD, *DFT, *SYSRPYL

*SAME
The method does not change.
*RQD
A reply is required for inquiry messages sent during the job.
*DFT
The default reply is used for inquiry messages sent during the job.
*SYSRPYL
The system reply list is checked for a matching entry. If none exists, a reply is required.

BRKMSG Break message handling

Specifies how break messages are handled for the job. This depends on the message queue status, the message queue severity, and this value.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *NORMAL, *NOTIFY, *HOLD

*SAME
Break message handling does not change.
*NORMAL
Break message handling is determined by the message queue status.
*NOTIFY
An audible alarm sounds for a message. Allowed only for interactive jobs.
*HOLD
Break messages are not shown, and the user break message handling program does not start.

STSMSG Status message

Specifies how status messages are handled for the job.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *USRPRF, *SYSVAL, *NONE, *NORMAL

*SAME
Status message handling does not change.
*USRPRF
The handling comes from the user profile (the initial profile of this thread, or the current profile of another job).
*SYSVAL
Status messages are shown or hidden as set by system value QSTSMSG.
*NONE
Status messages are not shown.
*NORMAL
Status messages are shown. Text on the bottom display line is lost.

DDMCNV DDM conversation

Specifies whether connections that use DDM protocols (APPC, TCP/IP, or OptiConnect) remain active when not in use. These protocols are used by DRDA, DDM, and DB2 Multisystem applications.

Type
*CHAR
Required
No
Default
*SAME
Length
5
Case
Uppercase

Allowed values: *SAME, *KEEP, *DROP

*SAME
The job's DDM conversation attribute does not change.
*KEEP
Connections stay active when there are no users, except in listed cases such as explicit disconnect, communications failure, or a DRDA connection to a non-IBM i server ending.
*DROP
The system ends a DDM-allocated conversation when there are no users.

SCDDATE Schedule date

Specifies the date on which the submitted job becomes eligible to run. *MONTHSTR and *MONTHEND are calculated as if the job did not use the Julian date format.

Type
*DATE
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME, *CURRENT, *MONTHSTR, *MONTHEND, *MON, *TUE, *WED, *THU, *FRI, *SAT, *SUN

*SAME
The value does not change.
*CURRENT
The job becomes eligible on the current date.
*MONTHSTR
The job becomes eligible on the first day of the month, today if today is that day and the SCDTIME has not passed.
*MONTHEND
The job becomes eligible on the last day of the month, today if today is that day and the SCDTIME has not passed.
*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.

SCDTIME Schedule time

Specifies the time on the scheduled date at which the job becomes eligible to run. The load on the system may affect the exact start time.

Type
*TIME
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME, *CURRENT

*SAME
The value does not change.
*CURRENT
The job is submitted at the current time.

DATE Job date

Specifies the date assigned to the job. It stays the same for the job's duration unless the user changes it, and it overrides the system date for this run only.

Type
*DATE
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME

*SAME
The job date does not change.

DATFMT Date format

Specifies the format used for the date.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *YMD, *MDY, *DMY, *JUL

*SAME
The date format does not change.
*SYSVAL
The value in system value QDATFMT is used.
*YMD
Year, month, day.
*MDY
Month, day, year.
*DMY
Day, month, year.
*JUL
Julian.

DATSEP Date separator

Specifies the date separator used for the date.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Suggested / special values: *SAME, *SYSVAL, *BLANK

*SAME
The date separator does not change.
*SYSVAL
The value in the system value for the date separator is used.
*BLANK
A blank is used as the separator.
'/'
A slash is used as the separator.
'-'
A dash is used as the separator.
'.'
A period is used as the separator.
','
A comma is used as the separator.

TIMSEP Time separator

Specifies the time separator used for the job. Times given on other commands must use this separator or none, or those commands fail.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Suggested / special values: *SAME, *SYSVAL, *BLANK

*SAME
The time separator does not change.
*SYSVAL
The value in system value QTIMSEP is used.
*BLANK
A blank is used as the separator.
':'
A colon is used as the separator.
'.'
A period is used as the separator.
','
A comma is used as the separator.

SWS Job switches

Specifies the switch settings for the eight job switches. Each is 0 (off), 1 (on), or X (unchanged). The switches can be set or tested in a CL program.

Type
*CHAR
Required
No
Default
*SAME
Length
50
Case
Uppercase

Suggested / special values: *SAME

*SAME
The eight switch values do not change.

TIMESLICE Time slice

Specifies the maximum processor time, in milliseconds, given to each thread before other threads get a turn. The minimum effective value is 8 ms. It does not carry into later routing steps if changed during a routing step.

Type
*INT4
Required
No
Default
*SAME
Range
1 to 9999999
Case
Uppercase

Suggested / special values: *SAME

*SAME
The time slice value does not change.

PURGE Eligible for purge

Specifies whether the job can be moved out of main storage to auxiliary storage at the end of a time slice or during a long wait. It is ignored when more than one thread is active in the job.

Type
*CHAR
Required
No
Default
*SAME
Length
5
Case
Uppercase

Allowed values: *SAME, *YES, *NO

*SAME
The purge value does not change.
*YES
The job can be moved out of main storage. A job with multiple threads is never purged.
*NO
The job is not moved out as a whole, though its pages may be moved when storage is needed.

DFTWAIT Default wait time

Specifies the default maximum time, in seconds, that a thread waits for a system instruction (such as the LOCK MI instruction) to acquire a resource. It is ignored for read operations to database files.

Type
*INT4
Required
No
Default
*SAME
Range
1 to 9999999
Case
Uppercase

Suggested / special values: *SAME, *NOMAX

*SAME
The default maximum wait time does not change.
*NOMAX
There is no maximum wait time.

DEVRCYACN Device recovery action

Specifies the recovery action for the job when an I/O error occurs on the *REQUESTER device. It applies only to interactive jobs.

Type
*CHAR
Required
No
Default
*SAME
Length
13
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *MSG, *DSCMSG, *DSCENDRQS, *ENDJOB, *ENDJOBNOLIST

*SAME
The work station recovery action does not change.
*SYSVAL
The value in system value QDEVRCYACN is used.
*MSG
The requesting program receives an error message that the I/O operation failed.
*DSCMSG
The job is disconnected automatically. On reconnect, it gets an I/O error message, and the display must be shown again.
*DSCENDRQS
The job is disconnected automatically. On reconnect, ENDRQS is issued for the previous request processor.
*ENDJOB
The job is ended immediately (*IMMED) and a job log is produced.
*ENDJOBNOLIST
The job is ended immediately (*IMMED) and no job log is produced.

TSEPOOL Time slice end pool

Specifies whether threads in interactive jobs are moved to another main storage pool at the end of a time slice. After a long wait, the thread returns to its original pool. It applies only to interactive jobs.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *NONE, *BASE

*SAME
The value does not change.
*SYSVAL
The value in system value QTSEPOOL at command time is used.
*NONE
A thread is not moved at the end of its time slice.
*BASE
A thread is moved to the base pool at the end of its time slice.

PRTKEYFMT Print key format

Specifies whether border and header information is printed when the print key is pressed.

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *NONE, *PRTBDR, *PRTHDR, *PRTALL

*SAME
The value does not change.
*SYSVAL
The value in system value QPRTKEYFMT is used.
*NONE
Neither border nor header information is printed.
*PRTBDR
Border information is printed.
*PRTHDR
Header information is printed.
*PRTALL
Border and header information are printed.

SRTSEQ Sort sequence

Specifies the sort sequence table used for string comparisons in this job.

Type
*QUAL
Required
No
Default
*SAME
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *SYSVAL, *HEX, *LANGIDUNQ, *LANGIDSHR

*SAME
The value does not change.
*USRPRF
The sort table comes from the user profile (the initial profile of this thread, or the current profile of another job).
*SYSVAL
The value in system value QSRTSEQ is used.
*HEX
No sort table is used; hexadecimal character values determine the sequence.
*LANGIDUNQ
A unique-weight sort table is used.
*LANGIDSHR
A shared-weight sort table is used.
*LIBL
All libraries in the thread's library list are searched until the first match is found.
*CURLIB
The thread's current library is used. If none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Sort sequence Sort sequence

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

LANGID Language ID

Type
*CHAR
Required
No
Default
*SAME
Length
50
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *SYSVAL

CNTRYID Country or region ID

Type
*CHAR
Required
No
Default
*SAME
Length
50
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *SYSVAL

CCSID Coded character set ID

Type
*INT4
Required
No
Default
*SAME
Range
1 to 65535
Case
Uppercase

Suggested / special values: *SAME, *USRPRF, *SYSVAL, *HEX

DECFMT Decimal format

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Suggested / special values: *SAME, *SYSVAL, *BLANK

CHRIDCTL Character identifier control

Type
*CHAR
Required
No
Default
*SAME
Length
9
Case
Uppercase

Allowed values: *SAME, *USRPRF, *SYSVAL, *DEVD, *JOBCCSID

SPLFACN Spooled file action

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *SYSVAL, *KEEP, *DETACH

WLCGRP Workload group

Type
*SNAME
Required
No
Default
*SAME
Length
10
Case
Uppercase

Suggested / special values: *SAME, *NONE

CPUTIME Maximum CPU time

Type
*INT4
Required
No
Default
*SAME
Range
1 to 9999999
Case
Uppercase

Suggested / special values: *SAME, *NOMAX

MAXTMPSTG Maximum temporary storage

Type
*INT4
Required
No
Default
*SAME
Range
1 to 2147483647
Case
Uppercase

Suggested / special values: *SAME, *NOMAX

PRCRSCPTY Processor resources priority

Type
*CHAR
Required
No
Default
*SAME
Length
7
Case
Uppercase

Allowed values: *SAME, *SYSCTL, *NORMAL, *HIGH, *LOW

DUPJOBOPT Duplicate job option

Type
*CHAR
Required
No
Default
*SELECT
Length
7
Case
Uppercase

Allowed values: *SELECT, *MSG

IBM command documentation

Generated from os/cl/catalog/CHGJOB.json and os/cl/help/CHGJOB.json.