In addition to other people's suggestions, let me make a couple points.
Your 'random dataset' approach is not very sound. You only get 11 possible
values out (0 to 10), and 9 of them have a likelihood of 10% . That means
that at any given time, the chance that the *next* data set will have the
same name as the current one is about 1 in 10. To be precise,
prob (nextnum = currentnum) =
prob(nextnum = currentnum | currentnum=1)*prob(currentnum=1) +
prob(nextnum = currentnum | currentnum=2)*prob(currentnum=2) +
prob(nextnum = currentnum | currentnum=3)*prob(currentnum=3) +
prob(nextnum = currentnum | currentnum=4)*prob(currentnum=4) +
prob(nextnum = currentnum | currentnum=5)*prob(currentnum=5) +
prob(nextnum = currentnum | currentnum=6)*prob(currentnum=6) +
prob(nextnum = currentnum | currentnum=7)*prob(currentnum=7) +
prob(nextnum = currentnum | currentnum=8)*prob(currentnum=8) +
prob(nextnum = currentnum | currentnum=9)*prob(currentnum=9) +
prob(nextnum = currentnum | currentnum=0)*prob(currentnum=0) +
prob(nextnum = currentnum | currentnum=10)*prob(currentnum=10) =
9 * .10 * .10 +
2 * .05 * .05
= .09 + .005 = .095
And that happens every time you do this. So, if you do this 20 times
in your programs, the odds of never over-writing your data due to having
the same data set name twice in a row is:
(1 - .095)**20 = 0.1358
so, the likelihood that one of your data sets gets trashed by this process
is now 86 percent. On each run. This is double-plus-ungood.
So your idea is fundamentally unsound.
Then, your approach is not good either. If you are running multiple
sessions hitting the same database, you need to look into database
and record locking issues. If you run separate sessions, the data sets
are in separate directories anyway, so the purpose of this escapes me.
If you are running a single SAS session and hitting a database multiple
times for the same reason, you are probably in need of a process
Perhaps, if you write back to SAS-L (not to me personally) and explain
what your larger goal is, then someone might be able to give you some
Windows Live Spaces is here! It easy to create your own personal Web site.