Sign in

docs ILE Concepts

Exception Messages and How They Are Sent

Exception Messages and How They Are Sent

Exception Messages and How They Are Sent

This topic describes the different exception message types and the ways in which an exception message may be sent.

Error handling for ILE and OPM is based on exception message types. Unless otherwise qualified, the term exception message indicates any of these message types:

Escape (*ESCAPE) : Indicates an error causing a program to end abnormally, without completing its work. You will not receive control after sending an escape exception message.

Status (*STATUS) : Describes the status of work being done by a program. You may receive control after sending this message type. Whether you receive control depends on the way the receiving program handles the status message.

Notify (*NOTIFY) : Describes a condition requiring corrective action or a reply from the calling program. You may receive control after sending this message type. Whether you receive control depends on the way the receiving program handles the notify message.

Function Check : Describes an ending condition that has not been expected by the program. An ILE function check, CEE9901, is a special message type that is sent only by the system. An OPM function check is an escape message type with a message ID of CPF9999.

For information about these message types and other message types, see the API topic collection of the Programming category of the IBM® i Information Center.

An exception message is sent in the following ways:

  • Generated by the system

    The operating system (including your HLL) generates an exception message to indicate a programming error or status information.

  • Message handler API

    The Send Program Message (QMHSNDPM) API can be used to send an exception message to a specific call message queue.

  • ILE API

    The Signal a Condition (CEESGL) bindable API can be used to raise an ILE condition. This condition results in an escape exception message or status exception message.

  • Language-specific verbs

    For ILE C and ILE C++, the raise() function generates a C signal. Neither ILE RPG nor ILE COBOL has a similar function.