CHGACGCDE (Change Accounting Code)

CHGACGCDE Command syntax diagram

 

Purpose

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

 

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 Link to PDF book.

  2. This command is conditionally thread safe. Access will be denied if the target job (either the job that the command is issued in or another job on the system) 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.

 

Optional Parameters

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

A job identifier is a qualified name with up to three elements. For example:

job-name

user-name/job-name

job-number/user-name/job-name

More information is in Commonly used parameters.

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

job-name: Specify the qualified name of the job whose accounting code is changed. If no job qualifier is given, all jobs currently in the system are searched for the job name. If more than one of the specified name is found, a qualified job name must be specified.

user-name: Specify the name of the user of the job whose accounting code is changed.

job-number: Specify the number of the job whose accounting code is changed.

ACGCDE
Specifies the accounting code used for the job.

*SAME: The value does not change.

*BLANK: The accounting code is changed to all blanks.

accounting-code: 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.

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.

Example for CHGACGCDE

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

This command changes the accounting code for job WS1, with user profile DEPT2, 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.

Error messages for CHGACGDCE

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