CL Command Reference - HLDJOB

CL Command List > HLDJOB Reference

Description:

The Hold Job (HLDJOB) command makes a job ineligible for processing by the system. The job is held until it is:
. Released by the Release Job (RLSJOB) command
. Cleared by the Clear Job Queue (CLRJOBQ) command
. Ended by the End Job (ENDJOB) command
. Ended (while the job is active) by the End Subsystem (ENDSBS) command, the End System (ENDSYS) command, or the Power Down System (PWRDWNSYS) command

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.


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.