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 behaviour | What happens | Typical use |
|---|---|---|
| Held | Output stays on the spool until someone reads, releases or purges it | Output you will read in SDSF, often class X or H |
| Print (write) | Output is queued for a printer or output product | Reports, statements, operator listings |
| Dummy or purge | Output is discarded without being written | Noisy 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.
| Command | Effect | Example |
|---|---|---|
| $D | Display | $D J1234 shows a job's status; $DA lists active jobs; $D I lists initiators; $D SPOOL lists spool volumes and use |
| $H | Hold | $H J1234 stops a job being selected for execution; it does not stop a job already running |
| $A | Release (allow) | $A J1234 releases a held job so it can be selected |
| $C | Cancel | $C J1234 cancels the job, including a running one; adding ,P also purges its output |
| $P | Stop 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 |
| $T | Set (change) attributes | $T J1234,C=B changes the job's class; $T I3,CLASS=AB changes the classes initiator 3 serves |
| $S | Start | $S I3 starts initiator 3 |
$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.
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
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.
On its own it begins JES2 shutdown processing. Always give the object, such as $P I3 or $P J1234, and double-check before submitting.
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
- Operators use $D, $H, $A and $C many times a day; developers usually do the same through SDSF action characters.
- Output class choices decide whether reports reach the business: a wrong class can mean a report sits held and nobody sees it.
- Security teams restrict JES2 commands through OPERCMDS profiles, so most developers can only act on their own jobs.
Key terms
Check your understanding.
Take this lesson's quiz and save your progress. Free.