Hi @nmck , Here is my suggestion. For arithmetic calculations variables need to be in numeric format in general. From the screenshot and your example code it looks like your data stored in character format, plus you are manipulating data using character functions, which is not quite correct. To calculate Total of 2 or more columns, we can use SUM function in data or sql step.
NEWTRANS_AMOUNT=SUM(PAYMENT_AMT, ADJUSTMENT_AMT);
To calculate total amount by group, the best is to use SUM function in PROC SQL along with GROUP BY clause.
proc sql;
create table want as
select*, sum(newtrans_amount) as Total
from have
group by CONSUMERNO;
quit;
... View more