In reply to john gaughan.

This sounds like an ANOVA simulation, or possibly a GLM if there are continuous covariates. See the topic "Simulate many samples from a linear regression model." If you have further questions, post the program you are trying to write (even if it doesn't work) to one of the SAS Support Communities.