Hello all,
i am trying to create a macro variable based of the value in table, but my macros are wrongly assigned.
table noerr
alert count
Note 3
Warni 7
table err
alert count
Note 4
Error 6
Warni 2
%macro gen;
data _null_;
set noerr;
if substr(alert,1,4)='NOTE' then do;
%let tomail=No Errors No Warning;
end;
if substr(alert,1,5)='WARNI' then do;
%let tomail=Warning found;
end;
if substr(alert,1,5)='ERROR' then do;
%let tomail=Error found ;
end;
run;
%mend;
%gen;
%put &=tomail;
1.what i want?
a. if alert=error then a macro variable 'tomail' should be created resolving to 'error found'.
( if there is 'Error' ,there is no need to assign or resolve for latter two)
b.else if alert=warni then a macro variable 'tomail' should be created resolving to 'Warning found'.
c.else if alert=note then a macro variable 'tomail' should be created resolving to 'No error found'.
Please suggest.
Thank You,