Hello, I need help merging the dates that do not match for 2 different datasets
Dataset #1: Screening
Group | Screen_date | Total_screen |
A | 1/1/2018 | 1 |
A | 2/1/2018 | 2 |
A | 3/1/2018 | 2 |
A | 5/1/2018 | 3 |
Dataset #2: Randomizaiton
Group | rand_date | Total_rand |
A | 1/1/2018 | 1 |
A | 2/1/2018 | 2 |
A | 4/1/2018 | 2 |
A | 5/1/2018 | 1 |
Want:
Group | New_date | Total_screen | Total_random |
A | 1/1/2018 | 1 | 1 |
A | 2/1/2018 | 2 | 1 |
A | 3/1/2018 | 2 | |
A | 4/1/2018 | | 2 |
A | 5/1/2018 | 3 | 1 |
I tried the following:
PRoc sql;
SELECT a.*
FROM dataset_1 a LEFT JOIN dataset_2 b ON a.group = b.group
where a.screen_date = b.rand_date
quit;
this gives me matched data: so 3 records match but not 2.
Thankss!!