Let's work backwards here.
First thing is that the VALUES clause wants actual VALUES and not EXPRESSIONS.
So if C,D and E are NUMERIC variables then do this The number of decimal places in the value inserted makes no difference. .80 and .8 are the exact same number.
insert into eff_all2(Cohort_new, N, c, d,e)
values ("Total","&ne_allt",&orr_pct,&orrc_pct,&dcr_pct);
If the C, D and E are character variables like COHORT_NEW and N then you need to add quotes around the values.
insert into eff_all2(Cohort_new, N, c, d,e)
values ("Total","&ne_allt","&orr_pct","&orrc_pct","&dcr_pct");
Note that if you could have used an expression then the PUT() function would have only worked if C, D and E were CHARACTER variables because formats always generate CHARACTER strings.
What type of numbers are original C, D and E values? Why did you multiple they mean by 100? The PERCENT format expects actual percentages as the values. So 50% would be the number 0.50. If you multiply by 100 and the display it with the PERCENT format you will get 5000% instead of 50%.
Finally why the heck are you generating the macro variables at all?
proc sql;
insert into eff_all2(Cohort_new, N, c, d,e)
select "Total","&ne_allt",mean(c),mean(d),mean(e)
from Efficacy
;
quit;
... View more