nodupkey option of proc sort will keep the first obs. So if you have already sort your data as you want. then you will get the max obs. data class; set sashelp.class; run; proc sort data=class ; by sex decending weight; run; proc sort data=class out=cl nodupkey ; by sex; run; Ksharp
... View more