Hello @cme2146,
PROC SQL with its count(distinct ...) syntax is a useful complement to PROC FREQ in the situation you've described. See two examples below.
/* Create test data for demonstration */
data have;
input id var1 var2 $;
cards;
1 90 B
1 105 B
1 108 A
2 85 B
3 95 C
3 101 C
3 100 A
3 97 A
4 110 C
4 104 B
4 104 A
5 75 C
5 80 C
5 80 B
5 70 B
;
proc sql;
select count(distinct id) label='Number of participants with VAR1>=100'
from have
where var1>=100;
quit;
Output:
Number of
participants
with
VAR1>=100
------------
3
proc sql;
select var2, count(distinct id) label='Number of participants'
from have
group by var2;
quit;
Output:
Number of
var2 participants
----------------------
A 3
B 4
C 3