Typical Errors
Some kinds of potential errors are common to many COBOL programs. In
almost every case, these conditions should cause the program to
abort. Even the exceptions usually deserve
a warning message.
Input File Errors
- Empty file
- Missing header
- Missing trailer
- Wrong record count on trailer
- No data between header and trailer
- Wrong sort sequence
- Cycle error
- Invalid record type
- Faulty structure; e.g. multiple record types which must reflect
some kind of hierarchical arrangement
Output File Errors
- No data to write, except maybe for header and trailer
- Out of space -- especially on a small machine like a PC (thanks to
Dave Demaree for reminding me of this
one)
Working Storage Table Errors
- Table overflow
- Empty table
- Invalid data
Internal Errors
- Invalid parameter passed to subprogram
- Nonsensical sequence of calls to subprogram (e.g. trying to read a
file after closing it)
- Fatal error reported by subprogram
- Invalid status code returned by subprogram
- Inability to allocate enough memory
- Corrupted data structures
- Unexpected selection of default in a case structure
(e.g. WHEN OTHER in an EVALUATE statement)
- Unexpected return code from IMS or some other subsystem
- Any inconsistency indicating the presence of a program bug
COBOL Home
COBOL Style Forum