You can use several COBOL language features to pinpoint the cause of a failure in a program.
If a failing program is part of a large application that is already in production (precluding source updates), write a small test case to simulate the failing part of the program. Code debugging features in the test case to help detect these problems:
related tasks
Tracing program logic
Finding and handling input-output errors
Validating data
Finding uninitialized data
Generating information about procedures
related references
Source language debugging (Enterprise COBOL Language Reference)