Hi:
With a little data "preparation", you can create the report you want with PROC TABULATE. Essentially, you need to make a numeric variable whose value will be 1 or 0 depending on whether you want to count the patient or not -- for a particular patient/event combination.
This program assumes that the events are all going to be spelled exactly the same. In other words, stroke will ALWAYS be "stroke" and not "stroke" for one obs and "strke" for another obs and "strokes" for another obs.
The new variable, COUNTTHIS, will be used as an analysis variable by PROC TABULATE. EVENT will be placed in the row dimension of the table and COUNTTHIS and N will be in the column dimension of the table.
This program assumes that the data already exists in the PT_EVENT data set.
cynthia
[pre]
proc sort data=pt_event;
by patient event;
run;
ods listing;
data uniq_pte;
set pt_event;
by patient event;
if first.event then countthis = 1;
else countthis = 0;
run;
** Print just to show result of using FIRST.EVENT;
proc print data=uniq_pte;
title 'Create Variable to Count Unique Patients for Each Event';
title2 '(Only the first event for every unique patient/event combo';
title3 'will get a 1 in order to be counted.)';
format date mmddyy10.;
run;
proc tabulate data=uniq_pte f=comma8.;
title 'Use Proc Tabulate';
class event;
var countthis;
table event all='Total',
countthis="Number Unique Patients" n="Number Events";
keylabel sum = ' ';
run;
[/pre]