Use CEEHDLR to register a user-written condition handler. See z/OS Language Environment Programming Reference for more information about CEEHDLR.
User-written condition handlers are automatically unregistered when the stack frame they're associated with is removed from the stack due to a return, GOTO out of block, or a move of the resume cursor. You can, however, call CEEHDLU to explicitly unregister a user-written condition handler. See z/OS Language Environment Programming Reference for more information about CEEHDLU.
Recursion is allowed if a handler is registered within a handler, and nested conditions are allowed.
It is invalid to promote a condition without returning a new condition token. You cannot promote a condition to a PL/I condition.
Syntax >>-condition_handler--(--c_ctok--,--token--,--result_code--,----> >--new_condition--)--------------------------------------------><
Response | Result_Code value | Action |
---|---|---|
resume | 10 | Resume at the resume cursor (condition has been handled). Unless the resume cursor has been moved, this response can only be used if the condition being handled specifically allows this form of resumption. |
percolate | 20 | Percolate to the next condition handler. If a result_code is not explicitly set by a handler, this is the default result_code. |
21 | Percolate to the first user-written condition handler for the stack frame that is before the one to which the handle cursor points. This can skip a language-specific condition handler for this stack frame as well as the remaining user-written condition handlers in the queue for this stack frame. | |
promote | 30 | Promote to the next condition handler. |
31 | Promote to the stack frame before the one to which the handle cursor points. This can skip a language-specific condition handler for this stack frame as well as any remaining user-written condition handler in the queue at this stack frame. | |
32 | Promote and restart condition handling at the first condition handler of the stack frame of the handle cursor. | |
fix-up and resume | 60 | Provide the fix-up actions indicated by new_condition and by any qualifying data values that apply to the condition; then resume execution. This response is only allowed if the resume cursor has not been moved and only if the condition being handled allows this response. new_condition must be set by the condition handler to request one of the specific actions for the condition. |
If result_code is not explicitly set by the handler, the default response is Value=20, Percolate to the next condition handler.
Symbolic feedback code (fc) | Severity | Message number | Fixup action |
---|---|---|---|
CEE0CE | 1 | 398 | Fixup with new input value. The service that signaled the condition is invoked again with the new argument value provided by the handler as qualifying data. |
CEE0CF | 1 | 399 | Fixup with new output value. The service that signaled the condition returns as its result, the value provided by the handler as qualifying data. |