Hello friends, I want to ask if it is possible to use proc sql to calculate summary statistics per grouping values. For example: Team variable has 3 possible values: a,b,c I want to group the values by using proc format : values a and b will belong to "a,b' and value c to "c" As you can see in the code output2 is not the desired result. Data tbl;
input ID Team $ Y;
CARDS;
1 a 2
2 b 4
3 b 6
4 c 8
5 a 10
6 a 12
7 a 14
8 c 16
9 c 18
10 c 20
;
run;
proc format;
Value $Ffmt
'a','b'='a,b'
'c'='c';
run;
PROC SQL;
create table ouput1 as
select Team ,
count(*) as No_Customers
from tbl
group by Team
;
QUIT;
PROC SQL;
create table ouput2 as
select put(Team,$Ffmt.) as Team_Category,
count(*) as No_Customers
from tbl
group by put(Team,$Ffmt.)
;
QUIT;
... View more