Coding a user-written condition handler

This topic describes how you can code a user-written condition handling routine and provides examples for Language Environment-conforming HLLs.

Your user-written condition handler can test for the occurrence of a particular condition by coding a 12-byte condition token or by coding a symbolic feedback code. You can use the Language Environment callable service CEEHDLR to register the condition handler. For information about using CEEHDLR, see User-written condition handler interface.

The USRHDLR runtime option enables you to register a user-written condition handler at stack frame 0 without having to recompile your application to include a call to CEEHDLR. This is particularly useful in supporting Fortran applications because Fortran applications are unable to directly call CEEHDLR.

Nested conditions can be used in your routine as long as the language your routine is written in allows it to be recursively entered. You should design the routine to handle specific conditions rather than designing the routine to handle a wide variety of conditions. You should also code the condition handling routine to respond to the original condition on the first pass of the stack, rather than coding a routine to handle T_I_U on the second pass of the stack. This helps ensure that the handling that you perform addresses the original condition. The more specific the condition is that you design the handler for, the more precise the fix can be.