SASUnit Examples  Version 1.5.0
_handleerror.sas
Go to the documentation of this file.
1 
40 %MACRO _handleError (i_macroname
41  ,i_errorcode
42  ,i_condition
43  ,i_text
44  ,i_verbose=0
45  );
46 
47 %IF %unquote(&i_condition) %THEN %DO;
48  1
49  %PUT;
50  %PUT --------------------------------------------------------------------------------;
51  %PUT ERROR(SASUNIT) &i_errorcode in Makro &i_macroname (Condition: &i_condition);
52  %IF "&i_text" NE ""
53  %THEN %PUT &i_text;
54  %PUT --------------------------------------------------------------------------------;
55  %PUT;
56  %LET g_error_code = &i_errorcode;
57  %LET g_error_msg = &i_text;
58  %LET g_error_macro= &i_macroname;
59 %END;
60 %ELSE %DO;
61  0
62  %IF &i_verbose %THEN %DO;
63  %PUT;
64  %PUT handleError: OK: &i_errorcode &i_macroname (Condition: &i_condition);
65  %PUT;
66  %END;
67 %END;
68 %MEND _handleError;