Hi, I would like to merge two datasets based on their time stamp: Dataset A TimeA 10:10 10:13 10:35 12:23 Dataset B TimeB 9:30 9:59 10:13 12:33 Now I would like to, for every entry in dataset A, find the nearest (earlier in term of time) entry in dataset B, the end result would look like: Dataset merged TimeA TimeB 10:10 9:59 10:13 10:13 10:35 10:13 12:23 10:13 The psedo code would look like: proc sql; create table merged as select * from A left Join B on A.TimeA > B.TimeB group by TimeA having (TimeA - TimeB) = min(TimeA - TimeB); quit; However, the dataset is prohibitively large (100+GB) for using such method (by merging all the observations in B that matches TimeA>TimeB, the size will be monstrous) , is there a way where I can just read the nearest time stamp from dataset B and merge it into A ? Many thanks. Hao
... View more