I used order by to order my randomly arranged data so now I have the following data :
data have;
input name $4. count ;
datalines;
john 100
Harr 90
Rick 80
Gini 70
kell 70
Rini 67
Holl 65
Radd 65
lola 60
;
What I want as the output is the top 5 names with the corresponding counts and then for the 6th row I want everything left to be grouped together labelled as 'Othr' and their counts summed.
john 100
Harr 90
Rick 80
Gini 70
kell 70
Othr 257
How can I achieve this?
Thanks in advance 🙂