Hi,

I have an Excel template file that I want to fill with data generated by Stata 16.
As I want to run multiple instances of Stata at a time I try to copy the Excel template file first, with a unique suffix added and then write on the copied file.

So I copy the file with a random integer added (that has an upper bound so high that it is extremely unlikely to have two files named identically):

Code:
* Random id for temporary Excel export file
global  excelId = runiformint(1, 9999999)
display $excelId

* Copy to temporary export file
copy    "input.xlsx" "temporary_${excelId}.xlsx", replace
However, after every start of Stata this gives the same sequence of random integers (5853096, 4477600, 2292545, ...) as Stata uses the default seed "123456789" after startup.

What I tried next: set a seed from current date and time

Code:
* Random id for temporary Excel export file
local   seed = tc(`c(current_date' `c(current_time)')
set     seed  `seed'
global  excelId = runiformint(1, 9999999)
display $excelId

* Copy to temporary export file
copy    "input.xlsx" "temporary_${excelId}.xlsx", replace
This works in theory, but time precision is only up to seconds, so I get the same random numbers if two instances execute the command within the same second, so the suffix is not unique.

The help is silent on setting a pseudorandom seed. Is there an option to avoid use of a seed?
My random numbers do not need to be repoducible, they even should not be!

I appreciate your help!