11-15-2016 01:11 AM
I am trying to analyze data involving if there was a hospitalization (Y/N) in the first 6 months from a transplant date. TRR transplant date is the date of transplant, SAS180 is 180 days after date of transplant, and then TRF status date is the date of follow up.
I want to tell SAS to look at Y/N for hospitalization if the TRF status date is between the time interval "date of transplant" and "SAS180". And remove any record if TRF status date is beyond the SAS180 date. Does anyone know what I can do to achieve this?
11-15-2016 02:05 AM
Can you assume you'll always have dates or do you need to account for missing data?
Anyways, you can compound your conditions using an AND
Length check $3.;
if status>=transplant AND STATUS<=sas180 then check='ok';
Then you can filter on your check variable. I create this variable so I can confirm my code before removing records - makes it easier to debug.
11-15-2016 09:48 AM
Thanks I will give this a try!
Ideally, I would want to capture if TRR Status Date was even within the same month and year of SAS 180 (if exceeds the interval by a few days, no big deal). But I feel that is too complicated in SAS? I was going to manually read it over.
11-15-2016 05:26 PM
What you suggested worked!
Do you know if there is a way I can expand this a bit more so it is not just the 6 month SAS 180 exact date but includes the entire month of SAS180 date?
So if the follow up date was 5/10/16 and the SAS 180 date was 5/05/16, I still want that to be included...
Need further help from the community? Please ask a new question.