Good morning, I have to merge 2 datasets (one-to-many) on a long list of condition, more than 20 factors. So if I have to use Proc SQL, the section of "ON a.var=b.var" will be very long. I wonder if there is any better way to do the merge both in terms of the code and the speed. Many thanks, JHN data condition; input time one two three ; datalines; 1 3 4 5 2 . 6 8 3 2 . . 4 9 6 . ;;;; data source; input number_client one two three ; datalines; 7 3 4 5 8 3 6 8 9 2 5 6 10 2 6 9 11 3 6 8 12 3 6 9 ;; run; proc sql; create table want as select * from condition as a left join source as b on (a.one = b.one or a.one is null) and (a.two = b.two or a.two is null) and (a.three = b.three or a.three is null) ; quit;
... View more