Put code in your programs that anticipates possible system or runtime problems. If you do not include such code, output data or files could be corrupted, and the user might not even be aware that there is a problem.
The error-handling code can take actions such as handling the situation, issuing a message, or halting the program. You might for example create error-detection routines for data-entry errors or for errors as your installation defines them. In any event, coding a warning message is a good idea.
COBOL for Windows contains special elements to help you anticipate and correct error conditions:
related tasks
Handling errors in joining and splitting strings
Handling errors in arithmetic operations
Handling errors in input and output operations
Handling errors when calling programs