The code below generates 337 observations. the two observations with missing prev_cpn_date were exluded. proc sql; create table temp_lin as select prev_cpn_date format=mmddyy10.,pri_id,as_of_date format=mmddyy10.,SERIES_VALUE,(prev_cpn_date-as_of_date) as diff from FLoat_Leg_fr_GDR,lib3rate where prev_cpn_date GT as_of_date order by prev_cpn_date, diff,pri_id ; create table look as select prev_cpn_date as dd format=mmddyy10.,min(diff) as mdiff from temp_lin group by prev_cpn_date; create table final_lin (drop=diff dd mdiff) as select * from temp_lin as a,look where a.prev_cpn_date=look.dd and a.diff=look.mdiff; quit; proc print;run;
... View more