Some advice on the code below please. Is this the right code for a dataset with millions of records where I want to restrict to the most recent record (maximum time_flag) and retain all the columns associated with it for each group ordered and defined by 3 variable? I fear using proc sort would take ages. * Take only the most recent record for each ID / var1 / var2 group; PROC SQL; create table spine as select distinct ID, Var1, Var2, Var3, Var4, time_flag, from mydataset as big group by ID, var1, var2 having time_flag = max(time_flag) order by ID, var1, var2; quit;
... View more