In reply to Hunter Glanz.

It sounds like you are asking about performing a Monte Carlo permutation test for the pairs (x_i, y_i) to test the null hypothesis that the variables are not correlated. See the article https://blogs.sas.com/content/iml/2021/06/07/permutation-tests-sorting-data.html

The article uses PROC IML, but, yes, you can also do this in base SAS:

Stack M copies of the X variables in one data set.
Use PROC SURVEYSELECT to stack M permuted copies of the Y variable in a second data set.
Merge the data sets.
Use PROC CORR with a BY statement to compute the distribution of the correlation coefficient under the null hypothesis.

If any of this is not clear, post you question to the SAS Support Communities and tag @Rick_SAS in your post.