<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: thanks. I have a question for ranuni(seed*&amp;i). in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30968#M5926</link>
    <description>thank U very much!!!&lt;BR /&gt;
&lt;BR /&gt;
Only the first seed encountered is used to initialize that random number stream.  Any additional seeds provided are ignored.&lt;BR /&gt;
&lt;BR /&gt;
to change streams,  can use the CALL RANxxx versions of the random number generators.

Message was edited by: sasJunior</description>
    <pubDate>Wed, 16 Mar 2011 20:32:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-03-16T20:32:27Z</dc:date>
    <item>
      <title>thanks. I have a question for ranuni(seed*&amp;i).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30966#M5924</link>
      <description>I test a code:&lt;BR /&gt;
&lt;B&gt;%let i=10;&lt;BR /&gt;
 data wjx;    &lt;BR /&gt;
A=2+200*ranuni(&amp;amp;seed1*&amp;amp;i);   &lt;BR /&gt;
B=Ranbin(75,1000,0.1);   &lt;BR /&gt;
C=100*ranuni(0);&lt;BR /&gt;
D=100*ranuni(3);     &lt;BR /&gt;
run;&lt;BR /&gt;
proc print data=wjx;run;&lt;/B&gt;&lt;BR /&gt;
wjx:&lt;BR /&gt;
A=13.6254    &lt;BR /&gt;
B=109   &lt;BR /&gt;
C= 62.0198    &lt;BR /&gt;
D=88.3135&lt;BR /&gt;
&lt;BR /&gt;
question:&lt;BR /&gt;
1.  when I changed seed1 or changed i(like%let i=110 ), the B,C,D gave me difference number,why?&lt;BR /&gt;
2, when I changed the B's seed or C's seed or D's seed values,the B,C,D always stayed same, why?&lt;BR /&gt;
&lt;BR /&gt;
 &lt;B&gt;data wjx;    &lt;BR /&gt;
A=2+200*ranuni(&amp;amp;seed1*&amp;amp;i);   &lt;BR /&gt;
B=Ranbin(175,1000,0.1);   &lt;BR /&gt;
C=100*ranuni(10);&lt;BR /&gt;
D=100*ranuni(23);     &lt;BR /&gt;
run;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
thanks a million!&lt;BR /&gt;
Alex</description>
      <pubDate>Wed, 16 Mar 2011 15:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30966#M5924</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-16T15:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: thanks. I have a question for ranuni(seed*&amp;i).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30967#M5925</link>
      <description>When you use the FUNCTION from of the random number generators SAS keeps only one SEED value in a memory location that we do not have control over.&lt;BR /&gt;
&lt;BR /&gt;
Therefore each RANzzz call uses the value stored in the same SEED buffer, regardless of whether it is the nth call to the same function or a different function.&lt;BR /&gt;
&lt;BR /&gt;
As stated in the documentation &lt;BR /&gt;
[pre]&lt;BR /&gt;
Tip: If you want to change the seed value during execution, you must use the CALL RANBIN routine instead of the RANBIN function.  &lt;BR /&gt;
&lt;BR /&gt;
and &lt;BR /&gt;
&lt;BR /&gt;
The CALL RANBIN routine, an alternative to the RANBIN function, gives greater control of the seed and random number streams.&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
This appies to RANUNI as well.</description>
      <pubDate>Wed, 16 Mar 2011 15:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30967#M5925</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-03-16T15:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: thanks. I have a question for ranuni(seed*&amp;i).</title>
      <link>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30968#M5926</link>
      <description>thank U very much!!!&lt;BR /&gt;
&lt;BR /&gt;
Only the first seed encountered is used to initialize that random number stream.  Any additional seeds provided are ignored.&lt;BR /&gt;
&lt;BR /&gt;
to change streams,  can use the CALL RANxxx versions of the random number generators.

Message was edited by: sasJunior</description>
      <pubDate>Wed, 16 Mar 2011 20:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/thanks-I-have-a-question-for-ranuni-seed-i/m-p/30968#M5926</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-16T20:32:27Z</dc:date>
    </item>
  </channel>
</rss>

