Hello to all, I try to learn stata by myself as a economist,

So I want to make a boucle to make a random sample

I want to draw 500 samples of 1000 obs, from 10000 obs

Also in this boucle, if possible, i want to create variable like
x1 -> x1_mean , x2-> x2_mean etc...

Thank to help me, I did'nt put the code because is not working