CHGPJ (Change Prestart Job)

CHGPJ Command syntax diagram

 

Purpose

The Change Prestart Job (CHGPJ) command changes the job attributes of the prestart job in which this command is issued to those in the job description specified in the prestart job entry, or to those in the job description specified in the user profile of the current user. When a program start request is received, the system will set the current user to the user profile specified in the program start request. The current user may subsequently be set to a different value by the Set Profile (QWTSETP) API.

 

Restrictions

  1. This command must only be called by a prestart job that is servicing a program start request. This command will not work against local prestart jobs.
  2. The user must have *USE authority to the job description.
  3. To change the OUTQ, the user must have authority to the new output queue and the old output queue. Authority to new output queue must not come from program adoption.
  4. This command is conditionally threadsafe. Refer to for additional information.

 

Optional Parameters

OUTPTY
Specifies the output priority for spooled files produced by this job.

*SAME: The value does not change.

*PGMSTRRQS: The value specified in the job description for the user profile of the current user is used.

*PJE: The value specified in the job description for the prestart job entry in the subsystem description is used.

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.

*PGMSTRRQS: The value specified in the job description for the user profile of the current user is used.

*PJE: The value specified in the job description for the prestart job entry in the subsystem description is used.

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.

*SAME: The value does not change.

*PGMSTRRQS: The value specified in the job description for the user profile of the current user is used. If *USRPRF is specified for this parameter value in the job description, the value specified in the user profile of the current user is used.

*PJE: The value specified in the job description for the prestart job entry in the subsystem description is used. If *USRPRF is specified for this parameter value in the job description, the value specified in the user profile for the prestart job entry (USER parameter) is used.

OUTQ
Specifies the qualified name of the output queue.

*SAME: The value does not change.

*PGMSTRRQS: The value specified in the job description for the user profile of the current user is used. If *USRPRF is specified for this parameter value in the job description, the value from the user profile of the current user is used.

*PJE: The value specified in the job description for the prestart job entry in the subsystem description is used. If *USRPRF is specified for this parameter value in the job description, the value from the user profile for the prestart job entry (USER parameter) is used.

ACGCDE
Specifies the accounting code used for the job.

*SAME: The value does not change.

*PGMSTRRQS: The value specified in the job description for the user profile of the current user is used. If *USRPRF is specified for this parameter value in the job description, the value from the user profile of the current user is used.

*PJE: The value specified in the job description for the prestart job entry in the subsystem description is used. If *USRPRF is specified for this parameter value in the job description, the value from the user profile for the prestart job entry (USER parameter) is used.

Examples for CHGPJ

Example 1: Changing the Output Priority

CHGPJ  OUTPTY(*PGMSTRRQS)

This command changes the output priority for spooled files produced by this job to the OUTPTY in the job description associated with the user profile of the program start request.

Example 2: Changing the Output Queue

CHGPJ  OUTQ(*PJE)

This command changes the output queue for spooled files produced by this job to the OUTPUT queue in the job description specified in the prestart job entry.

Additional Considerations

Considerations for Attribute Thread Safety

This command is intended to be used to change the job attributes for the prestart job that the command was issued in. All of the attributes are scoped to the job.

The Threadsafe column 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 the initial thread or from a secondary thread.
No:
Attributes marked with this value are not threadsafe. An attempt to change these attributes will be denied if multiple threads are active.

Table 1. Attribute and Thread Safety

Attribute Threadsafe
Job accounting code (ACGCDE) No
Output priority (OUTPTY) Yes
Output queue name (OUTQ) Yes
Print text (PRTTXT) Yes
Printer device name (PRTDEV) Yes

Error messages for CHGPJ

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