data want (keep=count_a count_b count_c);
set have end=done;
retain count_a count_a count_c 0;
if var < 0.2 then count_a + 1;
else if var <= 0.5 then count_b + 1;
else count_c + 1;
if done then output;
run;
Another method is to create a format, so the formatted values can be used in a simple freq:
proc format library=work;
value testfmt
low-<0.2 = 1
0.2-0.5 = 2
0.5<-high = 3
;
run;
data have;
input var;
format var testfmt.;
cards;
.1
.3
.6
.4
.5
.2
.7
;
run;
proc freq data=have order=internal;
tables var / nopercent nocum;
run;
... View more