PURGE
Removes a finished job and its output from the system.
Why it matters. Old jobs pile up. Purging keeps your queue short and easy to read.
Syntax
SDSF: /$P Jnnnnn (JES2 operator command, typed in SDSF) MF/OS terminal only: PURGE jobname | jobid TSO: CANCEL jobname PURGE JES2 operator: $P Jnnnnn SDSF: P beside the job
- Jnnnnn
- The job number. J10231 means JOB10231. In MF/OS you can also give a job name.
- CANCEL jobname PURGE
- The real TSO way to stop your own job and remove its output.
- $P Jnnnnn
- The JES2 operator command. It removes the job and its output once the job is done.
- P (in SDSF)
- The line command typed beside a job in the SDSF job list.
Try it PURGE
- 1
Open SDSF, the tool for working with jobs and the spool.
SDSF - 2
In SDSF, job CUSTCHK (JOB10231) has finished and you have read its output. Remove it with the JES2 purge command.
COMMAND INPUT ===> /$P J10231 - 3
Run the same command a second time. See what happens when the job is already gone.
COMMAND INPUT ===> /$P J10231
Remember
- $P (or P beside the job in SDSF) removes the job and its output.
- There is no undo. Read the output first.
- On a real system you do it with $P or P in SDSF, not at READY.
The usual mistake
/$P J10231, then OUTPUT CUSTCHK
The output went with the job. After PURGE there is nothing left in the spool to read.
OUTPUT CUSTCHK first, then /$P J10231 in SDSF
On real z/OS
PURGE is not a TSO command. The MF/OS terminal accepts it as a shortcut for the JES2 $P command, the SDSF P line command or CANCEL with PURGE; this page uses the real way, $P typed in SDSF. Issuing operator commands from SDSF needs authority on a real system (the SDSF settings and the OPERCMDS class in RACF). The key in the $HASP250 line is made up. MF/OS does not print the real $HASP003 text for a job that is not found.
Where can I practise PURGE?
Right here, at ZedBank. You take a junior job at a simulated bank and use PURGE in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- JobA unit of batch work submitted to the system, made up of one or more steps that run in order.
- SpoolThe system-managed holding area where job output waits to be read, printed or purged.
- SYSOUTOutput sent to the spool rather than to a dataset, where you can read it after the job finishes.
- JES2The job entry subsystem: the part of z/OS that queues jobs, decides when they run, and collects their output.
- SDSFThe tool for looking at what jobs are running, what has finished, and what output they produced.