Hi
I know easily how to do this code in Sql but how to do this count and case when on SAS statement?
Could someone give me some help?
Sql code:
Select count( subscr_id) as qty,
Case when m3_topup_index =0 THEN 'a.Zero'
when m3_topup_index > 0 and m3_topup_index<=0.5 THEN 'b.0-0.5'
when m3_topup_index > 0.5 and m3_topup_index<=1 THEN 'c.0.5-1'
when m3_topup_index > 1 and m3_topup_index<=1.5 THEN 'd.1- 1.5'
when m3_topup_index > 1.5 and m3_topup_index<=2.0 THEN 'e.1.5-2.0'
when m3_topup_index > 2.0 THEN 'f.Above 2.0'
else 'g.Other'
end as m3_topup_index_grp
/* The variable m3_topup_index_grp is not on my SAS dataset.
So how do I create it as I only have the variable m3_topu_index */
from ptwopperfs_1_may20 /* my sas dataset*/
group by subscr_id
I have tried this on SAS but is not correct:
proc summary data=perfmoni.ptwopperfs_1_may20 nway;
var m3_topup_index;
output out=want (drop=_:)
n=count_subscr_id
sum=sum_m3_topup_index;
run;