proc sort data=sashelp.class out=sorted_class; by descending Height ; run; proc print data=sorted_class obs="Rank"; title1 "Ranked observations when sorted by Height"; run;