I have a SAS data set, DataSet1, with among others, a character variable City, that can take 15 different values(city names). I want to find the 5 most frequent cities. The 10 remaining should be counted under the name "Others".
I want the frequencies presented in a new SAS data set, DataSet2, with the two variables City and Number. Number should be in descending order, but 'Others' should always be placed last, like this: