Hi I am working on a problem where I imported an Excel file to SAS and I need to Sort Salaries of Baseball players and print the top ten largest salaries. I tried to sort it but it is only sorting the first ten observations from my dataset from greatest to smallest and it is not getting the top ten greatest salaries from the entire dataset. This is my code below.
proc sort data=MLB out=salaries_sorted;
format Salary dollar12.3;
by descending Salary descending Year;
proc print data=MLB (obs=10);
run;
question from:https://stackoverflow.com/questions/65948802/sorting-data-to-get-top-ten-largest-salaries