Your code cannot use column 1 as the grouping variable. It is the result of an aggregate function.
Perhaps you meant there was some other variable you want to group by?
Let's add a variable ID to your example data and try that.
data have;
id=1;
column_b=1;
input column_a @@;
cards;
. . 1 . . . 1 . .
;
PROC SQL;
CREATE TABLE test AS
SELECT ID
, SUM(column_a) AS column_a
, SUM(column_b) AS column_b
, SUM(column_a)/SUM(column_b) as Rate format=percent8.2
FROM
have
GROUP BY
1
ORDER BY
1
;
quit;
proc print;
run;
... View more