SAS creating a count from other variable -
i have following column
var_1 3456 3456 3456 6 6 71 71 71 71
i want create variable data give me count of how many times each number repeated variable this:
count 3 2 4
i have no idea or clue how proceed on this. there in proc freq can use?
simple solution: proc sql:
data tbl; input var1; cards; 3456 3456 3456 6 6 71 71 71 71 ; run; proc sql; create table tbl2 select var1, count(var1) count tbl group var1 ; quit;
if literally want column (count), query count(var1), not sure why want column displaying count no value attached. if want create individual macro var count of each value, use proc sql select into:
...if asking.
Comments
Post a Comment