# S122: Cancelled by the operator, with a dump

Source: https://wndsoftware.com/mainframe-errors/s122

An S122 abend means the job or TSO session was cancelled with a CANCEL command that asked for a dump. The program didn't fail on its own. An operator or an automation rule decided to stop it.


### Other names for this code

Also written as `122`, `abend 122`, `system abend 122`, `S122 cancel`, `cancelled with dump`.


## What it means

An operator ends a running job with the CANCEL command. If the command includes the DUMP option, as in `CANCEL PAYRUN01,DUMP`, the step ends with system completion code 122. Without that option it ends with S222. TSO users cancelled with `CANCEL U=userid,DUMP` get the same code.

Operators rarely cancel a job that is behaving normally, so the reason for the cancel often lies in the program. The usual triggers are a job that seems to be looping, a job holding data sets or other resources that other work is waiting for, or a job still running after it should have finished, such as past the end of the batch window.

The dump is the useful part. If the step had a SYSUDUMP, SYSABEND or SYSMDUMP DD statement, the dump shows what the program was doing at the moment it was cancelled.


## Common causes

- The job looked like it was looping, using CPU without making progress, so the operator cancelled it with a dump to see where.
- The job held a data set, an enqueue or a tape drive that other jobs or an online system were waiting for.
- The job ran past its expected end time or into the online day, and an operator or the scheduler stopped it.
- Automation software cancelled it under a rule, such as a limit on run time.
- The job was stuck waiting for something that wasn't going to arrive, such as a tape mount or a data set held by another job, and an operator cleared it.


## How to find the problem

- Confirm it was a cancel. IEF450I shows ABEND=S122, and SYSLOG or OPERLOG shows a CANCEL command for the job, followed by `IEE301I jobname CANCEL COMMAND ACCEPTED`.
- Note the time of the command and where it came from, then ask operations why the job was cancelled.
- Read the job log just before the cancel. A message such as IEF099I (job waiting for data sets), or a long gap in the job's own progress messages, shows what state it was in.
- If a dump was taken, find the PSW and the active load module in it. For a loop, the PSW will be inside the loop, so match its offset to the compiler listing to find the statement.
- Compare the step's CPU and elapsed time with earlier runs, from SMF or your scheduler's history, to see whether this run was out of line.


## How to fix it

- If the job was looping, fix the loop. Common sources are a missing end-of-file test, a PERFORM UNTIL whose condition never becomes true, and a read that never moves to the next record.
- If it held resources others needed, change when it runs or how it allocates its data sets. For example, use DISP=SHR instead of DISP=OLD for data sets the step only reads.
- If it was slow but working, tune it, or tell operations and the scheduling team how long it really takes so it isn't cancelled again.
- Rerun or restart the step once you know the cause. A cancelled step may have left output data sets half written, so check them or restart from the step that creates them.


## What it looks like


```text
CANCEL PAYRUN01,DUMP
IEE301I PAYRUN01 CANCEL COMMAND ACCEPTED
IEF450I PAYRUN01 STEP030 - ABEND=S122 U0000 REASON=00000000
$HASP395 PAYRUN01 ENDED - ABEND=S122
```


## IBM documentation

[IBM z/OS: 122](https://www.ibm.com/docs/en/zos/3.1.0?topic=codes-122). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.

Last reviewed 2026-10-12 by the WND Software team. Written in our own words. For the full reference, check IBM’s z/OS documentation for your release.


## Related codes

[S222 Cancelled, without a dump Read →](https://wndsoftware.com/mainframe-errors/s222)
[S322 CPU time limit exceeded Read →](https://wndsoftware.com/mainframe-errors/s322)
[S522 Wait time limit exceeded Read →](https://wndsoftware.com/mainframe-errors/s522)
[S722 Output limit exceeded Read →](https://wndsoftware.com/mainframe-errors/s722)
[S622 TSO session ended after disconnect Read →](https://wndsoftware.com/mainframe-errors/s622)

## Questions


### What is the difference between S122 and S222?

Both mean the job was cancelled while it was running. S122 means the cancel asked for a dump, and S222 means it didn't.


### Why didn't my S122 produce a dump?

The DUMP option only writes a dump if the step has a dump DD statement, such as SYSUDUMP, SYSABEND or SYSMDUMP. Add one to the step if you want the next cancel to leave something to read.


### Should I just rerun the job?

Not until you know why it was cancelled. If it was looping or holding resources, a rerun will most likely end the same way.

[z/OS system abends](https://wndsoftware.com/mainframe-errors/zos-abends) · [S106](https://wndsoftware.com/mainframe-errors/s106) · [S137](https://wndsoftware.com/mainframe-errors/s137)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
