Hello @Mathis1,
In PROC SQL you can define a suitable sort key "on the fly" in an ORDER BY clause.
Example:
data have;
input stat $20.;
cards;
100% Max
99%
95%
90%
75% Q3
50% Median
25% Q1
10%
5%
1%
0% Min
Interquartile Range
Range
Mean
Variance
Std Deviation
;
proc sql;
create table want as
select *
from have
order by input(compress(scan(stat,1),,'kd'),3.), find('MSVRI',char(stat,1));
quit;
In the second expression in the ORDER BY clause you can define the sort order of the five non-quantile statistics using their initial letters: Just permute the string in the first argument of the FIND function. By exchanging the two expressions ("input(...)" and "find(...)") you can sort the quantiles first if you like.
Edit: I'm not quite sure if all features used in the ORDER BY clause were already available in v9.1, but you could definitely replace them by others to achieve what you want.
... View more