07-10-2017 10:04 AM
Im in doubt of how to set the seed when using the rand() function in proc sql. Im aware that the "call streaminit" routine can be used if one will use the rand function in datasteps. How do I do it in proc sql? Or alternatively in fedsql?
As example, lets say that I want to order the dataset "mydata" in a random order.
do i=1 to 20;
select * from mydata
order by rand('uniform');
07-10-2017 10:18 AM
I don't think you can set the seed, using the rand function in proc sql. It will automatically use the system clock. If you want to use a specific seed, you'd either have to use the ranuni function or run it in a data step where you can set a specific seed.
Art, CEO, AnalystFinder.com