Error Types
Error conditions fall into two broad categories: fatal and non-fatal.
Fatal Errors
With a fatal error, the program cannot usefully continue. For example:
- The program cannot allocate enough memory.
- An input file is corrupted or grossly invalid.
- An input file fails the cycle check.
- A WORKING-STORAGE table overflows.
- An internal inconsistency indicates the presence of a serious
programming error.
In case of a fatal error, the program should issue one or more
appropriate messages, shut itself down gracefully, and
abort.
Non-fatal Errors
With a non-fatal error, the problem is often confined to just part of
the data, and does not jeopardize the rest. Usually it occurs because
the input data are invalid or cannot be interpreted reliably.
Such a situation may require human intervention to fix the problem, but
it doesn't require that the entire job be halted. If the rest of the
file is healthy, it shouldn't be delayed on account of unrelated
data. Clearly these issues are specific to the application.
When it encounters a non-fatal error, the program should issue a
warning message, muddle through as well as it can, and continue
processing.
It remains possible that no one will pay any attention to the warning
message, but that's another story.
COBOL Home
COBOL Style Forum