@Ronein,
The macro only contains one data step that compute the reduced amount for a given factor :
%macro mmacro(factor,run);
data tttbl2_&run.;
set tttbl1;
Mis_New= min((Use*&factor.),Mis);
sum_Mis+Mis;
sum_Mis_New+Mis_New;
Reduced_amount=sum_Mis-sum_Mis_New;
call symputx("Reduced_amount",Reduced_amount,"G");
run;
%mend;
You can see that it contains your formula
Mis_New= min((Use*&factor.),Mis);
This macro is then used in the data history step, inside the do loop, for each tried value of the factor :
rc=dosubl(cats('%mmacro(',factor,',',run,');'));
dosubl is used since the reduced amount is computed in a separate data step.
... View more