z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


C++ to COBOL condition handling

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

This section provides two scenarios of condition handling behavior in a C++ to COBOL ILC application. If an exception occurs in a C++ routine, the set of possible actions is as described in Exception occurs in C++. If an exception occurs in a COBOL program, the set of possible actions is as described in Exception occurs in COBOL.

Keep in mind that some conditions can be handled only by the HLL of the routine in which the exception occurred. For example, in a COBOL program, a statement can have a clause that adds condition handling to a verb, such as the ON SIZE clause of a COBOL DIVIDE verb (which includes the logical equivalent of a divide-by-zero condition). This condition is handled completely within COBOL.

C++ exception handling constructs try()/throw()/catch() cannot be used with Language Environment and COBOL condition handling. If you use C exception handling constructs (signal()/raise()) in your C++ routine, condition handling will proceed as described in this section. Otherwise, you will get undefined behavior in your programs if you mix the C++ constructs with the C constructs. For a detailed description of Language Environment condition handling, see z/OS Language Environment Programming Guide.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014