I have many scenarios in which the following query will give me what I need -
proc sql;
create table test as
select ID,count(task) as count
from table
group by ID;
quit;
- The "tasks" that are being counted are SSN's which are character values.
I tried to replicate this using proc means
to expand my methods -
proc means data = table noprint;
class ID;
var task;
output out=test sum=tot;
run;
I get an error that reads -
ERROR: Variable TASK in list does not match type prescribed for this list.
I am assuming this is because I am telling it to "sum" a character variable, when really what I want to do is "count" the observations by ID. The word "sum" may not be the key word to use here, but I don't know what other keyword would give me a "count" by ID. Is this a simple syntax error in the proc means step, or is this the wrong approach?