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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -