Why is this macro not working?
%MACRO Cerved_recap;
%let i=2;
%DO i = 2 %TO &oggi.;
%let ieri = %sysevalf(&i.-1);
data work.initial_db_cerved;
set work.initial_db_cerved;
length esito_&i. $ 10;
format esito_&i. $char20.;
%if ENCOURS_TOTAL_&i. < ENCOURS_TOTAL_&ieri. %then %do; esito_&i.='total_out';
%end;
%else %do; esito_&i.= '-';
%end;
run;
%end;
%MEND Cerved_recap;
%Cerved_recap;