Mainframe Path Start learning free
Core11 min readLesson 2 of 3

Spool, output and the main JES2 commands

The spool holds every job's JCL and output. Output classes decide whether output prints, waits to be read, or is discarded. A small family of JES2 commands displays, holds, releases, cancels, purges and changes jobs, and the same letter can mean different things depending on what it is applied to.

The spool and the checkpoint

The spool is a set of disk volumes JES2 formats and owns. It stores input JCL, instream data, internal text and every SYSOUT dataset. Space is handed out in track groups. The checkpoint dataset holds the queues and job status, and in a multi-access spool every member shares it.

Output classes

Each SYSOUT dataset has an output class, from MSGCLASS= on the JOB statement or SYSOUT=x on a DD. What a class does is site configuration, set on its OUTCLASS definition:

Class behaviourWhat happensTypical use
HeldOutput stays on the spool until someone reads, releases or purges itOutput you will read in SDSF, often class X or H
Print (write)Output is queued for a printer or output productReports, statements, operator listings
Dummy or purgeOutput is discarded without being writtenNoisy output nobody reads

Output disposition can also be set per dataset with OUTDISP= on an OUTPUT statement (WRITE, HOLD, KEEP, LEAVE, PURGE). Sites often send production output to an archive or report product (for example IBM Content Manager OnDemand, or vendor products such as CA View or Control-D) rather than to paper.

Reading a JES2 command

JES2 commands start with the command character, normally $, followed by a verb and an object. The object can be a job (J1234 or JOB01234), a started task (S), a TSO user (T), an initiator (I3), a printer (PRT1) or a resource such as SPOOL. In SDSF you prefix a command with / to issue it. Whether you are allowed to is controlled by RACF profiles in the OPERCMDS class.

CommandEffectExample
$DDisplay$D J1234 shows a job's status; $DA lists active jobs; $D I lists initiators; $D SPOOL lists spool volumes and use
$HHold$H J1234 stops a job being selected for execution; it does not stop a job already running
$ARelease (allow)$A J1234 releases a held job so it can be selected
$CCancel$C J1234 cancels the job, including a running one; adding ,P also purges its output
$PStop or purge, depending on the object$P I3 drains initiator 3 after its current job ends; $P J1234 purges a job that is not executing
$TSet (change) attributes$T J1234,C=B changes the job's class; $T I3,CLASS=AB changes the classes initiator 3 serves
$SStart$S I3 starts initiator 3
Displaying a job (illustrative, format varies by release)
$D J4521
$HASP890 JOB(PAYRUN01)
$HASP890 JOB(PAYRUN01)  STATUS=(AWAITING EXECUTION),CLASS=A,
$HASP890                PRIORITY=9,SYSAFF=(ANY),HOLD=(JOB)

Here HOLD=(JOB) tells you the job itself is held, so $A J4521 (or the A action in SDSF) is what will let it run, assuming an initiator for class A is free. Always find out why a job was held before releasing it: the scheduler or an operator may have held it on purpose.

Commands and the scheduler

In most production shops, a workload scheduler submits and tracks jobs. Holding, releasing or cancelling a scheduled job directly in JES2 can leave the scheduler with the wrong picture: it may still think a job is running, or mark a cancelled job as failed and alert someone. Use the scheduler's own hold and cancel functions where they exist, and record any direct JES2 action in the incident notes.

TRY IT YOURSELF

Which JES2 command releases a held job JOB1234 so it can run?

Show a hint

The verb letter stands for 'allow'.

Show the solution

$A J1234 releases the job. $H would hold it.

Common mistakes

Expecting $H to stop a running job

Hold only stops a job from being selected for execution. To stop a running job you cancel it, after checking the impact on data and restart.

Typing $P without an object

On its own it begins JES2 shutdown processing. Always give the object, such as $P I3 or $P J1234, and double-check before submitting.

Working around the scheduler

Direct JES2 holds and cancels on scheduled jobs confuse the scheduler. Use the scheduler's functions and log anything you did directly.

What you will see at work

Key terms

Check your understanding.
Take this lesson's quiz and save your progress. Free.

Take the lesson quiz
← The life of a job inside JES2Working in SDSF and handling spool problems →