Hold Job (HLDJOB)

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

The Hold Job (HLDJOB) command makes a job ineligible for processing by the system. The job is held until it is:

Holding a job causes all threads within the job to be held.

Note: If you use this command to hold a job that has exclusive access to any resources on the system, these resources are not available to other jobs. Other jobs which require access to those resources will either fail or wait indefinitely.

Restrictions: 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 held, 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.

Top

Parameters

Keyword Description Choices Notes
JOB Job name Qualified job name Required, Positional 1
Qualifier 1: Job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
SPLFILE Hold spooled files *NO, *YES Optional, Positional 2
DUPJOBOPT Duplicate job option *SELECT, *MSG Optional
Top

Job name (JOB)

Specifies the name of the job being held.

This is a required parameter.

Qualifier 1: Job name

name
Specify the name of the job.

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

Hold spooled files (SPLFILE)

Specifies whether spooled output files created by the job being held are also held.

*NO
The spooled output files produced by the job are not held.
*YES
The spooled output files produced by the job are also held. Only those spooled output files which are on output queues in the library name space of the thread issuing this command will be held. If the Spooled file action (SPLFACN) job attribute is *DETACH and the job is ended while the spooled files are held, the spooled files cannot be released using the Release Job (RLSJOB) command. To release spooled files after the job has been removed from the system, use the Release Spooled File (RLSSPLF) command.
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

Example 1: Making a Job Ineligible for Processing

HLDJOB   JOB(PAYROLL)  SPLFILE(*YES)

This command makes the job named PAYROLL ineligible for processing. All spooled files for this job are also held.

Example 2: Holding a Job that has a Duplicate Name

HLDJOB   JOB(DEPTXYZ/PAYROLL)

This command holds the job named PAYROLL submitted by a user operating under the user profile DEPTXYZ. The qualified form of the job name is used when jobs with duplicate names exist in the system. Spooled files are not held.

Top

Error messages

*ESCAPE Messages

CPF1E52
Not authorized to hold job &1.
CPF1E53
Job &1 has ended and cannot be held.
CPF1E54
Job &1 cannot be held.
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.
CPF1340
Job control function not performed.
CPF1341
Reader or writer &3/&2/&1 not allowed as job name.
CPF1342
Current job not allowed as job name on this command.
CPF1343
Job &3/&2/&1 not valid job type for function.
CPF1344
Not authorized to control job &3/&2/&1.
CPF1345
Cannot hold job &3/&2/&1.
CPF1346
Job &3/&2/&1 already held.
CPF1347
Cannot hold job &3/&2/&1.
CPF1348
Job &3/&2/&1 held but unable to hold its files.
CPF1350
SPLFILE(*NO) specified but job &3/&2/&1 on OUTQ.
CPF1351
Function check occurred in subsystem for job &3/&2/&1.
CPF1352
Function not done. &3/&2/&1 in transition condition.
CPF1378
Job &3/&2/&1 not held at current time.
Top