There are two main concepts of Language Environment condition handling: the stack frame-based model and the unique, 12-byte condition token that it provides to communicate information about conditions to Language Environment resources and services.
Language Environment uses stack frames to keep track of a routine's order of execution, and the condition handlers available for each routine. This ensures that conditions can be isolated and handled precisely where they occur in a routine.
One of the most useful features of the condition handling model is the condition token: a 12-byte data type that contains information about each condition. You can use the condition token as a feedback code or to communicate with Language Environment message services. Unlike a return code, which is specific to the caller and callee of a routine, a condition token communicates between all the routines involved in an application. A condition token contains more instance-specific information about a condition than a return code does.
Language Environment supplements, but does not replace, existing HLL condition handling techniques such as C/C++ signal handlers (created using the signal() function), PL/I ON-units, and return code-based programming techniques. HLL condition handling techniques are discussed in Language Environment and HLL condition handling interactions.
Language Environment condition handling is most beneficial when used as part of mixed-language applications because it is consistent for all applications. If you are coding in a single language, you can use the condition handling semantics of that language, but if you have any ILC applications, you need the consistency across languages that Language Environment provides.
Language Environment can respond in many ways to a condition. For example, Language Environment can invoke a condition handler, a term used to define the specific routine that actually recognizes and responds to the condition. A condition handler can be registered by the CEEHDLR (register user-written condition handler) service, or be part of the language-specific condition handling services, such as a C/C++ signal handler or a PL/I ON-unit. HLL condition handling semantics that are intrinsic to the programming language also exist; an example is the COBOL ON SIZE phrase.