Hello,
I am trying to sum multiple observations with the First.Variable Last.Variable feature, however it never works in adding all the observations together, it either gives me the first or last variable values
Data T_Total;
set T;
by m**;
if first. m** then TOTAL_DAYS=0;
TOTAL_DAYS= sum (TOTAL_DAYS,SUPPLY_DAYS);
retain TOTAL_DAYS;
if last. m** then output;
run;
I also tried changing the order of sentences, or using the
TOTAL_DAYS= TOTAL_DAYS+SUPPLY_DAYS;