Hi Everyone,
I am working on a medical records data and I'm getting three separate files (Demographic file, Medication file, Diagnosis file). In each file, there is a specific date for a specific procedure. For instance, in the demographic file has a date for the time the patient visits the Emergency room, and in the diagnosis file there are dates for each diagnosis, and finally, the medication file has dates for each medication.
I want to merge all the three file in ONE dataset based on the date in the demographic file. So, I want to see if there is MATCHED date between the three files and merge them based on that. Is it possible? I have a full format date like this (28MAY2016).
Thanks,
You can match on dates. Note that all dates need to be SAS date values (numeric with a date format assigned).
MERGE works as long as you want exact matches only.
If diagnosis date might be the day after the ER date, (or if a medication date might be a few days after the ER date), MERGE would not be the best tool for the job.
Sometimes the record shows exact dates and some other observations have one or two days different. Any suggestions?
Can you provide any example data in the form of a data step?
Don't post any sensitive data but the data should be similar to yours, such as replacing patientid information with values like 1111 2222 3333 or such.
I have uploaded the sample of the data elements on a PDF. I just created a hypothetical number. I want to merge the demographic file with the medical condition file when (Visit_Date) in the demographic file matching with (BEG_EFFECTIVE_DT_TM) in the medical condition file.
Thanks,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.