SASUnit Examples  Version 1.5.0
_handleerror.sas File Reference

check for errors and set status code and messages More...

Go to the source code of this file.

Detailed Description

check for errors and set status code and messages

If the condition i_condition is true, a message is being issued to the SAS log and the following three macro symbols are assigned:

  • g_error_code ... value of i_errorcode (error code)
  • g_error_msg ... value of i_text (error message)
  • g_error_macro ... value of i_macroname (calling macro program)

The calling program should determine the name of the macro program currently running with the following line of code at the top of the program: %LOCAL l_macname; %LET l_macname = &sysmacroname ; Do not use &sysmacroname as the value of macro parameter g_error_macro directly , because otherwise it will have a value of "handleError".

If i_verbose has value 1, a message is being written to the SAS log even when i_errorcode is not a true condition.

Version
$Revision: 315 $
Author
$Author: klandwich $
Date
$Date: 2014-02-28 10:25:18 +0100 (Fr, 28 Feb 2014) $
See Also
For further information please refer to SASUnit User's Guide
$HeadURL: https://svn.code.sf.net/p/sasunit/code/trunk/saspgm/sasunit/_handleerror.sas $
Parameters
i_macronamename of macro where error condition occured
i_errorcodeerror code unique to the calling macro
i_conditioncondition - logical expression, will be evaluated and returned by the macro
i_texterror message, further information will be issued to the SAS log
i_verboseissue message to the SAS log even if i_condition evaluates to false, default is 0
Returns
evaluated i_condition

Definition in file _handleerror.sas.