/******************* URBAN INSTITUTE MACRO LIBRARY *********************
: Err_mput
Macro: Write a macro-generated error message to the SAS LOG
Description
using %PUT.
: Open code; Within macro
Use
: Peter Tatian
Author
***********************************************************************/
Err_mput(
%macro Macro=, /* Macro name */
Msg= /* Error message (macro string) */
);
/*************************** USAGE NOTES *****************************
:
SAMPLE CALLErr_mput( macro=MyMacro, Msg=Invalid parameter. )
%*********************************************************************/
/*************************** UPDATE NOTES ****************************
11/07/04 - If Macro= parameter blank, does not include [macroname] in
message. 09/06/05 - Reformatted so that message will be displayed in color
in SAS Enhanced Editor.
*********************************************************************/
***** ***** ***** MACRO SET UP ***** ***** *****;
%
%local SYL1 SYL2;
***** ***** ***** ERROR CHECKS ***** ***** *****;
%
***** ***** ***** MACRO BODY ***** ***** *****;
%
= ER;
%let SYL1
%if %length( ¯o ) = 0 %then %do;
= ROR:;
%let SYL2
%end;%else %do;
= ROR: [&Macro];
%let SYL2
%end;
&SYL1&SYL2 &Msg;
%put
***** ***** ***** CLEAN UP ***** ***** *****;
%
%mend Err_mput;
/************************ UNCOMMENT TO TEST ***************************
Err_mput( macro=MyMacro, Msg=Invalid parameter. )
%/**********************************************************************/
Write Error Message
Purpose: Write a macro-generated error message to the SAS LOG using %PUT.