Well, @ballardw is expressing it exactly right, people need a little more information to go on.
However, here is the hypothetical simplest query that I can imagine, to give you an idea of what they look like:
/* Create a textual format for the status field */
proc format lib=work;
value STf
1 = "open"
2 = "closed"
3 = "updated"
4 = "answered"
;
run;
/* Create some test data */
data ClinicalData;
informat TreatmentDate date9.;
format TreatmentDate yymmdd10. TreatmentStatus STf.;
input TreatmentDate TreatmentStatus;
cards;
20Mar2017 2
20Mar2017 3
20Mar2017 2
21Mar2017 1
21Mar2017 2
21Mar2017 1
21Mar2017 4
22Mar2017 1
22Mar2017 3
22Mar2017 1
run;
/* A couple of sample queries */
/* Get the treatment status for a given date */
proc sql;
select TreatmentStatus, count(*)
from ClinicalData
where TreatmentDate = "21mar2017"d
group by TreatmentStatus
order by TreatmentStatus;
quit;
/* Get the treatment status by date */
proc sql;
select TreatmentDate, TreatmentStatus, count(*)
from ClinicalData
group by TreatmentDate, TreatmentStatus
order by TreatmentDate, TreatmentStatus;
quit;
... View more