The second paragraph is mostly wrong. It starts well in the first sentence, but there are hundreds of additional system ABENDs that have nothing to do with an invalid instruction or data that is invalid for the instruction. Most system ABENDs encountered by most programmers are related to problems when a program attempts to open a dataset, and a problem of some sort is encountered.Quasar wrote:When a Program completes successfully, it sets a Return Code or COND CODE=00, to mark-off its successful completion. On the other hand, when the COBOL Program detects an error, it sets a non-zero (bad) Return-Code or COND CODE, to raise an alarm, a warning-signal, and complains.
At times, a Program attempts to execute an instruction at the machine code level, which is logically impossible. The MVS OS has to abnormally terminate or kill the program. This program crash is called an Abend. Every Abend leaves behind a System Abend-Code Sxxxx-yyy.
The term "ABEND" is the name of the Assembler macro that often initiates the termination. All system ABEND codes are three hexadecimal digits, often followed by a reason code that is sometimes decimal digits, and sometimes hexadecimal digits: S213-04, as an example when a program attempts to open a dataset that is not actually there.
The second and third hexadecimal digits of a system ABEND code are often the SVC used when the error is detected. S80A, for example, is often encountered when the system is attempting to execute an SVC X'0A' instruction. S213 when SVC X'13' is executing. This is not always true. S0Cx ABENDs are generally caused by program checks, either an invalid instruction or invalid data for an instruction.
The first paragraph also has problems. The term COND CODE, as used in
IEF142I XXXXXXJ EXECSUM A - STEP WAS EXECUTED - COND CODE 0000
is just another, probably poorly chosen, term for return code. All programs, not just Cobol programs, started by the JCL EXEC PGM=xxx statement end with a return code which is faithfully reported in the IEF142I message, even if the return code is garbage.