dataset 1: ID DATE 1 10/13/2010 1 10/20/2010 1 10/27/2010 1 11/3/2010 2 1/31/2011 2 1/31/2011 2 2/2/2011 2 2/7/2011 2 2/7/2011 3 7/26/2011 3 7/26/2011 3 7/28/2011 3 8/1/2011 3 8/2/2011 3 8/2/2011 3 8/4/2011 3 8/8/2011 3 8/9/2011 dataset 2: ID Count start end 1 1 10/18/2010 10/18/2010 2 1 2/1/2011 2/6/2011 3 1 7/27/2011 7/27/2011 3 3 8/2/2011 want: ID DATE Count 1 10/13/2010 1 10/20/2010 1 10/27/2010 1 11/3/2010 2 1/31/2011 2 1/31/2011 2 2/2/2011 1 2 2/7/2011 2 2/7/2011 3 7/26/2011 3 7/26/2011 3 7/28/2011 3 8/1/2011 3 8/2/2011 3 3 8/2/2011 3 3 8/4/2011 3 3 8/8/2011 3 3 8/9/2011 3 I want to merge the dataset1 and dataset2 by id and date, if the date in dataset1 falls in between start and end date of dataset2. in case if the end date is missing in the dataset2 then the count value should be retained across the rest of the observations in dataset1. Any help to achieve this in sas? Thanks
... View more