Mainframe · JES2 · SDSF

Purging the JES Spool in SDSF

jes2 sdsf spool

Many mainframe beginners will be familiar with how to manually purge job outputs from the JES spool one by one — that is, accessing the job status log via SDSF;ST and placing a P against the job entry to be purged. But there are ways we can purge multiple jobs without having to manually enter a P against each one.

Most site setups will have automation in place to clear the spool after a given amount of time has passed, but for various reasons we may want to clean up the spool sooner.

Method 1: Purging a Range

Let's consider that we are viewing the SDSF;ST panel with a filter of USER 'our UID' applied. There is a block of multiple job outputs in a row we wish to clear.

To purge a range of job outputs we can place a //P in the action column of the first job in the series, and a // in the last job of the series — much like entering block commands in an ISPF edit session. Hitting Enter will purge the selected job outputs (inclusive) and everything listed between them.

Method 2: JES2 Commands

JES2 commands can be entered the same way most MVS commands are — via the console, or in any SDSF panel prefixed with a /. JES2 commands are also prefixed with a $ to differentiate them from other system and product commands.

The command:

/$POJQ,JM=*

— or just $POJQ,JM=* from a console — will Purge Output from the Job Queue under the Job Mask *. As you may know from other MVS conventions, the wildcard * represents "any". So the above command will purge ALL job outputs. Be careful when issuing this as you may accidentally purge job outputs you didn't mean to.

Luckily, $PO offers many different parameters to target only certain subsections of job outputs. These parameters can also be mixed and matched within the same command to narrow down the subsection even further:

$POJQ,JM=JOB12* — Purge job outputs beginning with the name JOB12 $POJQ,Q=B — Purge job outputs in class B $POJQ,days>2 — Purge job outputs that are older than two days

For a full list of parameters and filtering options, refer to the JES2 Commands reference in the IBM documentation.