1. When running KurtBremser's code I get the following error message after the "where"-statement proc sql;
create table want as
select
PC4, year,
avg(x) as y,
count(*) as n_mean
from final_claims
where tag_sample = 1
group by PC4, year
;
quit; ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, EXCEPT, GE, GET, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=. ERROR 76-322: Syntax error, statement will be ignored. 2. Also, I was hoping to get a VARIABLE with these values. This seems to refer to the separate table. Is it possible to directly calculate these as a variable?
... View more