$P Job - Purge a job

Function

To cancel one or more jobs on the specified queue, including purging the job's output, and removing all traces of it from the system. If the job is active, wait for it to complete its current activity, then purge it from the system.

Syntax

Read syntax diagramSkip visual syntax diagram$P JobJOBQJQStcTsu nn-mm*'job'(,nn*-mm*job'job') ,ONERROR ,/CMDauth=^=cmdauth(,cmdauth),/Age/DAys><days,/Hours><hours,/JOBGROUP=^=><jobgroupname,/JM/JOBMASK=^=><jobmask,/PROTected,/Queue=^=CNVINPUTOUTPPUPURGERCVSETUPSPINXEQXMT,/REBUILD=^=NoYes,/SPL/SPOOL=(,/%/Percent><percent/Tgs><tgs/Volumes=^=volume(,volume)),/TYPE=^=JOBSTCTSU,BUSY=YESANYNONONE,CARDS=cards,Class=class,OFFS=offs,SCHENV=schenv,SCHENV_AFF=member,SECLABEL=seclabel,SECLABEL_AFF=member,SRVCLASS=srvclass/Sysaff=memnameANYIND(memnameANY,=^=memnameANYIND3),USERID=userid,HOLD=ALLJOBDUPARMNONE,DELAY=BUSY_ON_DEVICEHOLDLIMITLOCKEDSECLABELSYSAFFSCHENVMEMBER_STATUS=YESNO,CC=( ,ABENDCODETYPE),/XEQNode=^=xeqnodeSelection limiting keywords
Selection limiting keywords
Read syntax diagramSkip visual syntax diagram,/JC/JOBCORR=^=><job correlator,/DUBIOUS=¬=YesNo,/XEQHours><hours
Notes:
  • 1 cmdauth can be coded up to 2 times
  • 2 volume can be coded up to 253 times
  • 3 Multiple Sysaff values can be coded up to 33 times

Parameters

Age|DAys<days | Age|DAys>days
Specifies the age of affected jobs in days. Only jobs more (with DAYS>nn) or less (with DAYS<nn) than the specified number of days in age are affected. The days are counted from the current hour.
Age is computed by subtracting the job's "begin time" from the current time. That is, the time that the job was initially added to its current queue is the "begin time" except:
  • The "begin time" for jobs that are actively running is the same as the time the command was entered. That is, the age for running jobs is always zero days and hours.
  • The "begin time" for jobs in the OUTPUT or HARDCPY queue is the time that the job ended execution. If the job does not run, then the time is the time that the job was placed in its prior queue.
BUSY=
Specifies one of the following:
  • The system name or number on which the job is busy. Note that you can specify a value of 0 to indicate that the job is not busy. You can also specify values above 32 to match systems with invalid values in the BUSY value (for example, $PJOBQ,BUSY>32)
  • YES or ANY, indicating that all busy jobs are to match.
  • NO or NONE, indicating that all non-busy jobs are to match.
CARDS=cards
Specifies the number of input cards that are associated with the job.
CC=(ABEND|ABENDED|CANcelled|CNVT_abend|CODE| COMPleted|ENDed_by_cc|EOM_failure|FLUSHED|JCLerror| SECurity_failure|TYPE)
Specifies the completion information that is associated with the job.
ABENDED
Specifies only jobs which have abnormally ended.
ABEND
Specifies the ABEND code associated with the job's termination.
CANcelled
Specifies only jobs which were cancelled by the operator.
CNVT_abend
Specifies only jobs which have abnormally ended during the conversion phase.
CNVT_ERROR
Specifies job that failed due to a converter error.
CODE
Specifies the last (or highest) completion code of steps in the job.
COMPleted
Specifies only jobs which completed.
ENDed_by_cc
Specifies only jobs which were ended by a step completion code.
EOM_failure
Specifies only jobs which failed in end-of-memory processing.
FLUSHED
The job was cancelled (flushed) and is no longer eligible to run.
JCLerror
Specifies jobs which did not execute due to a JCL error.
SECurity_failure
Specifies jobs which failed security validation.
SYSTEM_FAILURE
Specifies jobs that failed due to system failure.
Class=class
Specifies a job class used to select a subset of jobs that have a matching job class. Wildcard characters can also be specified: see Using wildcards for details.
CMDauth=cmdauth
Only the jobs that can be affected from the specified remote(s) or node(s) are released. The valid specifications are:
LOCAL|ANYLOCAL
Only the local devices at the local node can affect the output.
Nnnnn|nodename
Only local devices at the specified node can affect the output.
Rnnnn
Only the specified remote device can affect the output.
NnnnnRnnnn|nodename.Rnnnn
Only the specified remote device at the specified remote node can affect the output.
destid
A destid corresponding to any of the above remote devices.
Note: Specification of the CMDAUTH filter does not override the authority of the console from which the command is issued; both the authority of the console and the specified CMDAUTH filter must match for the job to be affected.
DELAY={BUSY_ON_HOLD|HOLD|LIMIT|LOCKED| No|QUEUE_ERROR|SCHENV|SECLABEL|SPOOLS_NOT_AVAILABLE|SYSAFF| MEMBER_STATUS|Yes}
Specifies reasons why a pre-execution job does not enter execution:
BUSY_ON_DEVICE
The job does not execute because it is busy on a device (such as an offload job transmitter).
HOLD
The job does not execute because it is held, its job class is held, or another job with the same jobname is executing.
LIMIT
The job does not execute because the job class execution limit has been reached (as specified by JOBCLASS XEQCOUNT=(MAX=)).
LOCKED
The job does not execute because it's being updated by JES2.
SECLABEL
The security label (SECLABEL) assigned to the job is not defined as active on any member that is active.
SYSAFF
Each of the members for which the job has affinity (SYSAFF) is inactive, or the job has specified independent state, and the JES2 member is not independent (IND=NO).
SCHENV
The job's scheduling environment is not available on any member, or is available only on systems where JES2 is inactive. Use the $DJ'jobname',LONG command to find out what scheduling environment a job requires. Then use the D WLM,SCHENV=schenv-name command to find out the current status of the scheduling environment on each system in the sysplex.

The SCHENV state masks other reasons why the job might be ineligible to run, such as the $P and $P XEQ commands having been issued. Also, note that the SCHENV delay is detected only after a job goes through conversion. If a job is delayed before conversion because of system affinity requirements, scheduling environments are not considered in determining delay status.

MEMBER_STATUS
A combination of system affinity, scheduling environment, and SECLABEL restrictions is preventing the job from running or other member events prevent the job from running on systems where the job is otherwise eligible. These events on other members include the following:
  • $P command has been issued
  • $P XEQ command has been issued
  • BOSS=NO (used in a poly-JES environment only)

When used as a command filter, the string MEMBER_STATUS matches on jobs delayed for SYSAFF, SCHENV, SECLABEL, or MEMBER_STATUS. To get detail on why a job is delayed, display job status with the $DJ'jobname',LONG command or display member status with the $DJMEMBER(member-name) command.

Yes
Display only jobs which are delayed for any of the above reasons.
No
Display only jobs which are not delayed for any of the above reasons.
DUBIOUS=YES|NO
Indicates whether the job is considered dubious based on NJE path verification processing. A job is considered dubious if the job:
  • Was marked dubious by another node in the NJE network.
  • Arrived from NJE but claims to be from the local node.
  • Claims to originate from an unknown NJE node.
  • Violated the subnet routing rules.
  • Arrived by way of NJE store and forward but claims to be from a node that is defined as DIRECT=YES.
  • Specifies to run on the adjacent node from which it just arrived.
  • Has inconsistent origin node information (origin node in the NJE Header and SAF token do not match).
H|Hours=hours
Specifies the age of affected jobs in hours. Only jobs more (with HOURS>nn) or less (with HOURS<nn) than the specified number of hours in age are affected.
HOLD
Specifies the hold status of the job.
ALL
Specifies jobs held by the $H A command.
JOB
Specifies jobs held by the $H J command, TYPRUN=HOLD, TYPRUN=JCLHOLD, or held due to error.
DUP
Specifies jobs held for duplicate job name.
ARM
Specifies jobs which are held awaiting restart through ARM.
NONE
Specifies jobs which are not held.
JC|JOBCORR=job correlator
Specifies a combination of 1-64 alphanumeric, special (colon, period or underscore) and wildcard characters that can be used to select a subset of jobs that have a matching job correlator. For a description of wildcard characters, refer to Using wildcards.
JOBGROUP=jobgroupname
Specifies 1 to 8 alphanumeric, special ($, #, or @) or wildcard characters (or a combination of them) that can be used to select a subset of jobs whose job group name matches this combination of characters (mask).
JM|JOBMASK=jobmask
Specifies 1 to 8 alphanumeric, special ($, #, or @) or wildcard characters (or a combination of them) that can be used to select a subset of jobs whose job name matches this combination of characters (mask). For a description of wildcards, see Using wildcards.
Note:
  1. This is a positional parameter. Specify this following the job_id (JOB, STC, or TSU) or JOBQ parameter.
  2. The JOBMASK parameter is not valid with the ‘jobname ' parameter.
job
Specifies 1 to 8 alphanumeric, special ($, #, or @) or wildcard characters (or a combination of them) that can be used to select a subset of jobs whose job name matches this combination of characters (mask).
‘job'
The name of the job that is cancelled. This name must appear as coded on the JOB statement and must be enclosed in apostrophes. If more than one job exists with this name, no action is taken.
Job
A batch job or range of batch jobs is to be cancelled.
JOBQ|JQ
Specifies all jobs, STCs, and TSUs across the MAS for processing.
OFFS=offs
Specifies offload device numbers on which the job has been archived.
ONERROR
When specified, allows JES2 to purge email messages on a specific email queue after an attempt to deliver the email message failed because of a z/OSMF server error. This option applies only to email message queues, and is ignored for all other types of jobs.
PROTected
Indicates that all specified output groups, including output groups that have been specified ‘protected', should be purged. The 'protected' attribute is assigned to programs running in a transactional environment such as APPC or OMVS, where the transaction output is associated with the initiators like ASCHINIT or BPXAS. The ‘protected' attribute can also be assigned to jobs by JES2 installation exits. APPC output is always protected.
Note: Since the OUTGRP= parameter identifies the output to be cancelled, you do not need to specify PROTECTED with this operand, even for output that is protected.
Queue={CNV|INPUT|OUT|PPU|PURGE|RCV| SETUP|SPIN|XEQ|XMT}
Only jobs on the specified job queue are to be purged.
CNV
Only jobs awaiting conversion are to be cancelled.
INPUT
Only jobs on the JES2 $INPUT queue are to be cancelled.
OUT
Only jobs awaiting output processing are to be cancelled.
PPU
Only jobs awaiting print/punch processing are to be cancelled.
PURGE
Only jobs awaiting purge processing are to be cancelled.
RCV
Only jobs on the JES2 $RECEIVE queue are to be cancelled.
SETUP
Only jobs on the JES2 $SETUP queue are to be cancelled.
SPIN
Only jobs awaiting spin processing are to be cancelled.
XEQ
Only jobs awaiting execution are to be cancelled.
XMT
Only jobs queued for network transmission are to be cancelled.
REBUILD={No|Yes}
Jobs on the rebuild queue are to be cancelled (Yes) or not cancelled (No).
SCHENV=schenv
Specifies the scheduling environment associated with the job.
SCHENV_AFF=member
Specifies the JES2 MAS members on which the scheduling environment for this job is available.
SECLABEL_AFF=member
Specifies the JES2 MAS members on which the SECLABEL for this job is available but only if the RACF® SECLABEL_BY_SYS is also active.
SECLABEL=seclabel
Specifies the security label associated with the job.
SPL|SPOOL={Percent|%|Tgs|Volumes}
Only jobs with specific SPOOL characteristics are to be cancelled:
Percent|%
Only jobs using more (with %>nn) or less (with %<nn) than the specified percentage of the total available spool space are to be cancelled.
Tgs
Only jobs using more (with Tgs>nn) or less (with Tgs<nn) than the specified number of track groups are to be cancelled.
Volumes=(v1,v2,...)
Only jobs which have allocated spool space on the specified spool volume(s) are to be cancelled.
SRVCLASS=srvclass
Specifies the service class of the job. The service class is available for batch jobs only. It is not available for started tasks or time-sharing users. The default workload manager (WLM) policy assigns a service class of blanks to all jobs, and WLM-managed initiators can then select such jobs for processing.
Stc
A started task or range of started tasks is to be cancelled.
Sysaff
Specifies jobs to process based on this system affinity. Up to 33 entries can be coded by using a combination of the following values:
memname
Specifies the identifier (one to four characters using A-Z, 0-9, $, #, and @) of a member in the JES2 multi-access spool configuration that a job has in its system affinity list.
ANY
Specifies jobs that are eligible to run on any member in the JES2 multi-access spool configuration. If you specify ANY followed by the IND parameter, they must be separated by a comma and the list must be enclosed in parentheses, for example, (ANY,IND).
IND
Specifies the job that is selected and must be executed on a processor operating in independent mode.
Tsu
A time-sharing user or range of time-sharing users is to be cancelled.
TYPE={JOB|STC|TSU}
Indicates whether only batch jobs (JOB), started tasks (STC), or time-sharing users (TSU) are to be cancelled.
USERID=userid
Specifies the user ID associated with the job.
XEQHours=hours
Specifies the number of hours that a job has been executing. Only jobs that run more (with XEQH>nn) or less (with XEQH<nn) than the specified number of hours are affected, with the restriction that requires that the jobs must be executing.
XEQNode=xeqnode
Only jobs which are destined to execute at the specified node, or that have already executed at the specified node, are to be cancelled. The node name may be specified using the decimal node number (Nnnnnn) or an EBCDIC node name.

Related commands

To purge a job's output data set, see the $PO Job command.

Authority required

This command requires job authority. The description of the $T RDRnn command explains how to ensure that the authority of the appropriate MVS™ system command group is assigned.

This command requires update security access authority. For a description of assigning command input authority, see z/OS JES2 Initialization and Tuning Guide.

Scope

MAS-wide. This command has an effect across the entire MAS.

Messages

The $HASP890 message displays the jobs that are to be deleted.

If all output has been purged for a specified job, JES2 issues the $HASP250 message to indicate that the job has been purged.

Examples

 1   $p j'myjob'

  JOB00002  $HASP890 JOB(MYJOB)
  $HASP890 JOB(MYJOB)     STATUS=(AWAITING EXECUTION),CLASS=A,
  $HASP890                PRIORITY=9,SYSAFF=(IBM1),HOLD=(NONE),
  $HASP890                PURGE=YES

Job MYJOB is purged from the system.

 2   $p jobq,q=ppu,days>2

  JOB00002  $HASP890 JOB(MYJOB)
  $HASP890 JOB(MYJOB)     STATUS=(AWAITING HARDCOPY),CLASS=A,
  $HASP890                PRIORITY=1,SYSAFF=(IBM1),HOLD=(NONE),
  $HASP890                PURGE=YES
  TSU00065  $HASP890 JOB(D96CLW1A)
  $HASP890 JOB(D96CLW1A)  STATUS=(AWAITING HARDCOPY),CLASS=A,
  $HASP890                PRIORITY=1,SYSAFF=(IBM1),HOLD=(NONE),
  $HASP890                PURGE=YES

All batch jobs, STCs, and TSUs awaiting print that are more than two days old are purged from the system.

 3   $pj9,age<1

 JOB00009  $HASP890 JOB(IE)                                  
 $HASP890 JOB(IE)        STATUS=(AWAITING PURGE),CLASS=A,    
 $HASP890                PRIORITY=1,SYSAFF=(ANY),HOLD=(NONE),
 $HASP890                PURGE=YES                           
 JOB00009  $HASP250 IE PURGED -- (JOB KEY WAS B3FB7D66)      
 

JES2 purges job 9 if age is less than one day.

 4   $pj9-25,/days>1
     
 $HASP003 RC=(52),                                    
 $HASP003 RC=(52),J9-25  - NO SELECTABLE ENTRIES FOUND MATCHING 
 $HASP003         SPECIFICATION  

JES2 purges jobs 9 through 25 if age is greater than 1 day.

 5  $pj(*),jc=*:inventory,age>200

JOB00141  $HASP890 JOB(INVJOB01)                                        C
$HASP890 JOB(INVJOB01)  STATUS=(AWAITING PURGE),CLASS=A,                 
$HASP890                PRIORITY=1,SYSAFF=(ANY),HOLD=(NONE),             
$HASP890                PURGE=YES 
JOB00142  $HASP890 JOB(INVJOB02)                                        C
$HASP890 JOB(INVJOB02)  STATUS=(AWAITING PURGE),CLASS=A,                 
$HASP890                PRIORITY=1,SYSAFF=(ANY),HOLD=(NONE),             
$HASP890                PURGE=YES                                        
JOB00143  $HASP890 JOB(INVJOB03)                                        C
$HASP890 JOB(INVJOB03)  STATUS=(AWAITING PURGE),CLASS=A,                 
$HASP890                PRIORITY=1,SYSAFF=(ANY),HOLD=(NONE),             
$HASP890                PURGE=YES                                        
JOB00144  $HASP890 JOB(INVJOB04)                                        C
$HASP890 JOB(INVJOB04)  STATUS=(AWAITING PURGE),CLASS=A,                 
$HASP890                PRIORITY=1,SYSAFF=(ANY),HOLD=(NONE),             
$HASP890                PURGE=YES                                        
JOB00143  $HASP250 INVJOB03 PURGED -- (JOB KEY WAS C88BDD25)             
JOB00142  $HASP250 INVJOB02 PURGED -- (JOB KEY WAS C88BDD24)             
JOB00141  $HASP250 INVJOB01 PURGED -- (JOB KEY WAS C88BDD23)             
JOB00144  $HASP250 INVJOB04 PURGED -- (JOB KEY WAS C88BDD26)             

JES2 purges any batch job with an age greater than 200 days and a job correlator user portion is the value INVENTORY.