Hello adrfinance,
data testInput;
input qy $ balance;
datalines;
2010Q1 100
2010Q1 100
2010Q2 150
2010Q2 150
2010Q3 50
2010Q3 50
2010Q4 20
2010Q4 20
2011Q1 300
2011Q2 300
run;
proc sql;
SELECT qy, balance,
SUM (balance) as sum_balance_per_quarter
from testInput
GROUP BY qy;
quit;
Or you can improveit with subquery to show the overall Total Balance:
proc sql;
select qy,balance,sum_balance_per_quarter,SUM(sum_balance_per_quarter) as Total from (SELECT qy, balance,
SUM (balance) as sum_balance_per_quarter
from testInput
GROUP BY qy) as Result;
quit;
Hope it helps
Regards
CSB