HLDJOB (Hold Job)
Purpose
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
If the job is not run before the OS/400 system is ended, the queue can be cleared (and the job ended) when the OS/400 system is started again. The specified job to be held can be on the job queue or on the output queues, or it can be active in a subsystem. Holding a job causes all threads within the job to be held. This command also specifies whether the job's spooled files are 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. Restriction: 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.
Required Parameters
- JOB
- Specifies the qualified name of the job being held. If no job qualifier is given, all of the jobs currently in the system are searched for the job name. If more than one of the specified names are found, a qualified job name must be specified.
A job identifier is a special value or a qualified name with up to three elements. For example:
job-name user-name/job-name job-number/user-name/job-nameMore information on this parameter is in commonly used parameters.
job-name: Specify the name of the job being held.
user-name: Specify the name of the user of the job being held.
job-number: Specify the number of the job being held.
Optional Parameters
- SPLFILE
- Specifies whether spooled files created by the job being held are also held.
*NO: The spooled files produced by the job are not held.
*YES: The spooled files produced by the job are also 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.
- 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.
Examples for HLDJOB
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.
Error messages for HLDJOB
*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.