proc surveyselect generating different samples

Reply
New Contributor
Posts: 3

proc surveyselect generating different samples

Was curious if anyone has ever run into this issue?  I ran the the following code in Base SAS:

PROC SURVEYSELECT DATA = USER.INPUT1 METHOD = SRS REP = 1

    SAMPSIZE = 270000 SEED = 12345 OUT = USER.OUTPUT1;

RUN;

and have gotten the same output sample every time.  However, when I run this code as a program in Enterprise Guide, I get a different sample.

Sample is EG sample is random, and the only reason it matters as I was helping a colleague convert some Base SAS programs to EG and

started noticing some slight differences in outpu

Super User
Posts: 10,500

Re: proc surveyselect generating different samples

When you specify the same seed you will get the same result set given the same input. See the documentation for Surveyselect. Either change seed or remove to generate diferent result sets.

New Contributor
Posts: 3

Re: proc surveyselect generating different samples

That is what I thought should be the case, but it is not.  I have now tested it several different ways, but in its simplest form:

Base SAS:

- I import a File A

- Run the Proc Surveselect I listed

EG:

- I import File A

- Run the exact same Proc Surveselect I listed as a program

I get different samples...

Super User
Posts: 10,500

Re: proc surveyselect generating different samples

EG and Base SAS are likely running different streams for the random number stream.

They are NOT the same process. Run the select twice in BASE or EG and I suspect you get the same result. If you need to get the same result, run on the same platform.

New Contributor
Posts: 3

Re: proc surveyselect generating different samples

Thanks for the input. I figured that was the case.

Ask a Question
Discussion stats
  • 4 replies
  • 425 views
  • 3 likes
  • 2 in conversation