Programming the statistical procedures from SAS

Random number issue

Accepted Solution Solved
Reply
Contributor DCL
Contributor
Posts: 35
Accepted Solution

Random number issue

Hi,

 

Ever since I migrated to a new SAS server, i notice that random number generation for a seed value [334766080] gets different in this new server.

Code

data A(drop=i);

call streaminit(334766080);

do i = 1 to 5;

x123 = rand("uniform"); output;

end;

run;

 

Results In OLD server

    x123

0.7852188905
0.1264403092
0.5529167121
0.8073481501
0.3563103683

 

Results in NEW Server

    x123

0.9406947785
0.9712292252
0.0413521428
0.5594002416
0.1823783112

 

 

Seed value is exactly the same. Is there something else which affects the random number generation process? 

 

Thanks in advance!

Dilip

 

 

 


Accepted Solutions
Solution
3 weeks ago
Contributor DCL
Contributor
Posts: 35

Re: Random number issue

[ Edited ]

It seems that there is a change in random number generation from SAS/STAT14.1

 

https://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_whatsnew_se...

 

When I added following option, I get old results Smiley Happy

OPTIONS SET=SAS_RNG_METHOD=MT1998;

 

Thanks,
Dilip

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,288

Re: Random number issue

What is the difference between your "OLD" and "NEW" server?

 

A test with SAS 9.4 TS1M2 on AIX gave me your "OLD" results; a test with 9.2 on the same platform also.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor DCL
Contributor
Posts: 35

Re: Random number issue

Hi Kurt,

 

Sorry- i forgot to mention that.

 

OLD server= SAS9.3

New Server= 9.4 (TS1M3 MBCS3170)

 

Thanks,
Dilip

 

Solution
3 weeks ago
Contributor DCL
Contributor
Posts: 35

Re: Random number issue

[ Edited ]

It seems that there is a change in random number generation from SAS/STAT14.1

 

https://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_whatsnew_se...

 

When I added following option, I get old results Smiley Happy

OPTIONS SET=SAS_RNG_METHOD=MT1998;

 

Thanks,
Dilip

Esteemed Advisor
Posts: 6,288

Re: Random number issue

Since it does seem to affect not only certain SAS/STAT procedures, but the random function in Base SAS, this is good to know.

 

It also explains why I got the "old" numbers. Our SAS/STAT is at 13.2.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 87 views
  • 1 like
  • 2 in conversation