TRAP

TRAP indicates whether COBOL intercepts exceptions.

Read syntax diagramSkip visual syntax diagram
TRAP option syntax

         .-ON--.     
>>-TRAP(-+-OFF-+-)---------------------------------------------><

Default is: TRAP(ON)

If TRAP(OFF) is in effect, and you do not supply your own trap handler to handle exceptional conditions, the conditions result in a default action by the operating system. For example, if your program attempts to store into an illegal location, the default system action is to issue a message and terminate the process.

ON
Activates COBOL interception of exceptions
OFF
Deactivates COBOL interception of exceptions

Usage notes