- data a;input num:$11. id $1. aa:$10. ab:$10. ar ac;
- cards;
- 13404800000 a 2006-04-01 2007-04-01 800 968
- 13404800007 b 2006-05-01 2011-04-01 209 1164
- 13404800012 c 2006-12-19 2013-03-01 38 22
- 13404800014 c 2006-12-08 2012-08-01 11 1
- 13404800016 c 2006-12-30 2011-05-01 121 566
- 13404800020 d 2006-06-30 2010-09-01 136 478
- 13404800021 d 2006-06-30 2010-09-01 136 478
- ;
- run;
- proc format;
- value fd 0-<10="<10元"
- 10-<20=">=10元and<20元"
- 20-<50=">=20元and<50元"
- 50-<80=">=50元and<80元"
- 80-<120=">=80元and<120元"
- 120-<200=">=120元and<200元"
- 200 <- high=">=200元";
- run;
- proc sql;
- create table b as
- select
- put(ar,fd.) as ar
- ,count(distinct id) as id_cnt
- ,count(distinct num) as num_cnt
- from a
- group by
- calculated ar
- ;
- quit;