BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

I have a question about changing random seed for every round in the loop.

Say I have a loop:

do i=1 to 1000;

...then in one of the following steps I need to use proc surveyselect which requires me to specify a random seed (e.g., seed=123).

because I need to get different random samples, I want different seed for different i (e.g., seed=123 for i=1, seed=124 for i=2, seed=125 for i=3...).

It seems to me a positive integer should follow the seed= statement. Is there anyway to achieve the above mentioned procedure?

Thank you very much for your help!

sliu
4 REPLIES 4
DanielSantos
Barite | Level 11
Hello sli.

Anything wrong about not specifying the SEED option and let SAS use the default which is the time of day of the system's clock?

Cheers from Portugal.

Daniel Santos @ www.cgd.pt;

run;
deleted_user
Not applicable
Thank you, Daniel!
That's fine for my current purpose. But I would like it to be able to replicate in the future.
DanielSantos
Barite | Level 11
OK.

Then you should take a look on macro variables.

Check the online documentation:
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002293823.htm

Easily accomplished with a macro variable.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
deleted_user
Not applicable
I will! Thanks!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 726 views
  • 0 likes
  • 2 in conversation