What if Your Program Has an ABEND?

An ABEND is an ABnormal ENDing. This means that your program has done something that forces the system to take charge and end the execution.

If this occurs, a message from the JCL or from Assist will indicate that you have a condition code (or return code) such as S0C1, S0C2, etc. What do these mean? Here are a few of them.


S0C1

This is called an Operations Exception.

The interrupt code in the PSW is 0001.

It means that an attempt has been made to execute an invalid op code.

Generally this happens because:

  1. The flow of execution encountered a DS or DC statement, or

  2. during execution, some valid section of code was accidentally overwritten.

Look at the dump and examine the ABENDing instruction, and then figure out how you got there.


S0C4

This is called a Protection Exception.

The interrupt code in the PSW is 0004.

It means that a D(B) or D(X,B) address resolved to an absolute address outside of your program. (Usually this happens when you try to store a value somewhere; you can't modify memory you don't own.)

Generally this happens because:

  1. An index/base register contains an excessively large value, or

  2. an index/base register was inadvertently changed.

Look at the ABENDing instruction. What index and base registers were used? What were their values?


S0C5

This is called an Addressing Exception.

The interrupt code in the PSW is 0005.

It means that a D(B) or D(X,B) address resolved to a value greater than the highest address actually available. In this case that is X'FFFFFF' as ASSIST is actually limited to 24-bit addresses.

In other regards it is similar to S0C4. Take the same steps.


S0C6

This is called a Specification Exception.

The interrupt code in the PSW is 0006.

It means that a D(B) or D(X,B) address resolved to a value that is not on the kind of boundary needed (fullword or halfword or doubleword) for the instruction involved.

Make sure that any label used is on the correct kind of boundary. Make sure variables are declared to be the correct type (such as F instead of CL4). Also take same steps as for S0C4.


S0C7

This is called a Data Exception.

The interrupt code in the PSW is 0007.

It means that an attempt was made to do a packed-decimal operation (arithmetic, comparisons) using data that is not in the packed-decimal format.

Check each operand in the instruction and look in the dump for its value. Back-track the history of that variable to see where it got its value. Check the lengths on packed-decimal instructions.


322

This means that the program ran out of time.

The reason is almost always an endless loop. Don't do that.


722

This means that the program exceeded the maximum number of lines available for printing output.

The reason is almost always an endless loop. Again, don't do that.