I suggest you begin with
%let m=500;
%let n=5;
%let alpha=0.10;
then write a DATA step that generates m samples, each of size n.
Run PROC UNIVARIATE with BY-group processing on the Sample ID variable.
Then analyze the empirical frequency of the indicator variable ( KS > alpha ).
For hints and similar Monte Carlo estimates, see
"Using simulation to estimate the power of a statistical test"
which uses PROC TTEST (on two independent samples) instead of the KS (on one sample).
After everything is debugged and working, it is trivial to wrap the code into a macro.
... View more