Change Accounting Code (CHGACGCDE)

Where allowed to run: All environments (*ALL)
Threadsafe: Conditional
Parameters
Examples
Error messages

The Change Accounting Code (CHGACGCDE) command changes the accounting code of a job. The job can be on a job queue, or it can be active in a subsystem. This command has no effect if the job is on an output queue. If the command is entered when system value QACGLVL indicated that job accounting (*JOB) should be performed when the job entered the system, accounting information is journaled and a new accounting segment is started for the job. If the command is entered when the system value QACGLVL did not indicate job accounting should be performed, the accounting code is changed, but no journal entry is made. More information is in the Work Management information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

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. More information about the job user identity is in the Work Management information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

  2. This command is conditionally thread safe. Access will be denied if the job being changed has secondary threads active. This command may be issued from either the initial thread or a secondary thread of a multi-threaded job if the target job is single threaded.
Top

Parameters

Keyword Description Choices Notes
JOB Job name Single values: *
Other values: Qualified job name
Optional, Positional 1
Qualifier 1: Job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
ACGCDE Accounting code Character value, *SAME, *BLANK Optional, Positional 2
DUPJOBOPT Duplicate job option *SELECT, *MSG Optional
Top

Job name (JOB)

Specifies the name of the job whose accounting code is changed.

Single values

*
The job whose accounting code is changed is the job where this command is issued.

Qualifier 1: Job name

name
Specify the name of the job whose accounting code is changed.

Qualifier 2: User

name
Specify the user name that identifies the user profile under which the job is started.

Qualifier 3: Number

000000-999999
Specify the system-assigned job number.

Note: If no user name or job number is specified, all jobs currently in the system are searched for the job name. If more than one occurrence of the specified name is found, a qualified job name must be provided either explicitly or through the selection display. Refer to the Duplicate job option (DUPJOBOPT) parameter for more information.

Top

Accounting code (ACGCDE)

Specifies the accounting code used for the job.

*SAME
The accounting code is not changed; accounting information is recorded in a journal and a new accounting segment is started.
*BLANK
The accounting code is changed to all blanks.
character-value
Specify the 15-character accounting code used for the next accounting segment. The accounting code may contain alphabetic or numeric characters. Blanks may also be used if the accounting code is enclosed in apostrophes.
Top

Duplicate job option (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. Otherwise, a message is issued.
*MSG
A message is issued when duplicate jobs are found.
Top

Examples

CHGACGCDE   JOB(123581/USER47/WS1)  ACGCDE(123456789)

This command changes the accounting code for job WS1, with user profile USER47, and job number 123581, to accounting code 123456789 for the next accounting segment. A job resource usage journal entry is written to the system accounting journal QSYS/QACGJRN.

Top

Error messages

*ESCAPE Messages

CPF1314
Value &1 for parameter &2 not allowed.
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.
CPF180B
Function &1 not allowed.
Top