Hello, I have two datasets (testa and testb) which I like to merge by the date-values . But I can not merge by the date-variable itself because sometimes the dates differ by some days but should be written to the same observation. Therfore I want to introduce a range according to the date of the first dataset und merge the information of the second dataset only if that date fits into that range. On the bottomline I try to solve this problem: data testa; input nr date_a date_low date_up int $@@; cards; 1 3 1 5 e 1 5 3 7 ee 2 4 2 6 f 3 8 6 10 g 4 8 6 10 h 4 13 11 15 i ;run; data testb; input nr date_b empf $@@; cards; 1 2 a 1 2 b 3 8 c 4 9 d ;run; *This is what I want to get; data testz; input nr date_a date_low date_up int $ date_b empf $@@; cards; 1 3 1 5 e 2 a 1 3 1 5 e 2 b 1 5 3 7 ee . . 2 4 2 6 f . . 3 8 6 10 g 8 c 4 8 6 10 h 9 d 4 13 11 15 i . . ; run;
... View more