Max, Hopefully this will get you started. As Mark pointed out, you should also check the manual. You can also use scoping messages to accomplish about the same thing. The biggest problem I see with these APIs is that you cannot pass a level like you can with the message APIs, which means that you cannot effectively wrap them in a custom interface. ************************************************** ****************************** ************** * CEEHdlr Register error handler. * * Output: * * FBCod Feedback code. * * Input: * * pPrc Procedure to call. * * pDta Pointer to parameter value. * ************************************************** ****************************** ************** DCeeHdlr PR D PR_ErrPrc * CONST PROCPTR D PR_ErrDta * CONST OPTIONS(*OMIT) D PR_FBCod 12A OPTIONS(*OMIT) ************************************************** ****************************** ************** * CEERtx Register call stack exit. * * Output: * * FBCod Feedback code. * * Input: * * pPrc Procedure to call. * * pDta Pointer to parameter value. * ************************************************** ****************************** ************** DCEERtx PR EXTPROC('CEERTX') Register callstk ext D PR_pPrc * PROCPTR CONST Procedure pointer D PR_pDta * CONST OPTIONS(*OMIT) Data pointer D PR_FBCod 12A OPTIONS(*OMIT) ... At top of program C* Register end of call stack procedure C CALLP CEERtx( C %PADDR('YOUREXITPROCEDURENAME'): C *OMIT: C *OMIT) C* Register unexpected error handler C CALLP CEEHdlr( C %PADDR('YOURABNORMALPROCEDURENAME'): C *OMIT: C *OMIT) ************************************************** ****************************** ************** * *YOURABNORMALPROCEDURENAME * ************************************************** ****************************** ************** PYOURABNORMALPR...B EXPORT DYOURABNORMALPR...PI D CurCnd 12A CONST D pUsrDta * CONST D RtnCod 10I 0 D NewCnd 12A *... Do abnormal cleanup stuff. *... Do normal cleanup stuff. C CALLP YOUREXITPROCEDURENAME C RETURN PYOURABNORMALPR...E ************************************************** ****************************** ************** * *YOUREXITPROCEDURENAME * ************************************************** ****************************** ************** PYOUREXITPROCED...B EXPORT DYOUREXITPROCED...PI *... Do normal cleanup stuff. PYOUREXITPROCED...E David Morris