Does anybody have sample codes for tracking query status (open,closed, updated, answered etc) for recurring report in a clinical database?
Please expand on that question. What is open/close/whatever? A table, a report object? A variable in a data table?
It may help if you have data and specific questions to post some example data, please recode an sensitive variables and provide an example of desired output from that example data. If you have data in a SAS data set there are tools to turn your SAS data into data step code. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
Sorry, just trying to get sas codes examples on tracking clinical data query in a typical clinical database.
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.