I'm confused about your data. What does C0 represent??? Are there any other identifying variables in your data, such as a name or category variable???
Also, I do not understand the logic of why total(cols), in the lower left-hand corner is 15. If you add 3 + 6 + 9, (the numbers in each row), you get 18, not 15. There is only 1 cell where C0 = 1. But, it also seems like you are adding the 1 for C1, C2 and C3 in the row total (of 3), but excluding them from the column total to get the 15??? That does not seem consistent with your statement that you want "Total(Cols) is the sum along column where Col0 not =1."
There is actually no need for the PROC SQL step in your code. PROC REPORT, using a COMPUTE block, can calculate a value for a row total, as shown in the example below. The program creates 2 report items CALCTOT1 and CALCTOT2, based on the use of the SALES, INVENTORY and RETURNS variables from SASHELP.SHOES. I just made up some formulas, although a simple SUM function would work as well.
ods html file='c:\temp\calc_row_tot.html' style=sasweb;
proc report data=sashelp.shoes nowd;
title 'Method 1 - Create a computed column with a calculation';
where region in ('Asia', 'Canada', 'Pacific');
column region product sales inventory returns calctot1 calctot2;
define region / group;
define product / group;
define sales / sum 'Sales';
define inventory / sum 'Inventory';
define returns / sum 'Returns';
define calctot1 /computed 'Sales + Inventory/minus Returns' f=dollar12.;
define calctot2 / computed 'Some other formula';
calctot1 = sum(sales.sum, inventory.sum, (-1*returns.sum));
calctot2 = (sum(sales.sum, inventory.sum, returns.sum) / 100) * .05;
rbreak after / summarize;
break after region / summarize;
compute after region;
line ' ';