Your update includes important information ... that each client/market/status gets totaled separately. Here's one way:
proc sort data=have;
by id_client market status date;
run;
data want;
set have;
by id_client market status;
if first.status then tot_amount = amount;
else tot_amount + amount;
run;
I agree that this looks more like a report than a data set, but that's not for me to judge. This should get you what you are asking for.
Good luck.
... View more