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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 942 views
  • 0 likes
  • 2 in conversation