Relative Content

Tag Archive for sas

How to retain days and stop in conditional situation and then keep going?

I am trying to count the duration of medication use. I would like to count days that every outpatient visit if they are not exceed 90 days between every visit.
The med_date is the date of every outpatient visit. I first use lag function to count the days between each visit(variable diff).
And I want to retain them and stop if the diff>90.
Then keep going with another id.
My code would stop if the diff>90, but I have no idea how to keep going

Issues while converting dates into SAS format

I have a big dataset with dates in the char format dd/mm/yyyy (e.g., 07/06/2014) I would like to convert into SAS format. I tried using input (variable_name, MMDDYY10.) but with the following issues:

Format dates as sas dates

I’m in a really frustrating situation.
I received a dataset to be analyzed. It contains dates as follows: