<?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 ranuni in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647709#M193870</link>
    <description>&lt;P&gt;Why the ranuni Function generate the random numbers&amp;nbsp; is not effect.Such as&lt;/P&gt;
&lt;P&gt;data aa;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;y=ranuni(10);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Why run the code twice ,but the result is sample.&lt;/P&gt;
&lt;P&gt;I want to know how to use the sas to generate the random numbers 1 to 9.&lt;/P&gt;
&lt;P&gt;as the programming of the python has random function to generate.&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 07:06:05 GMT</pubDate>
    <dc:creator>shursulei2</dc:creator>
    <dc:date>2020-05-14T07:06:05Z</dc:date>
    <item>
      <title>ranuni</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647709#M193870</link>
      <description>&lt;P&gt;Why the ranuni Function generate the random numbers&amp;nbsp; is not effect.Such as&lt;/P&gt;
&lt;P&gt;data aa;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;y=ranuni(10);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Why run the code twice ,but the result is sample.&lt;/P&gt;
&lt;P&gt;I want to know how to use the sas to generate the random numbers 1 to 9.&lt;/P&gt;
&lt;P&gt;as the programming of the python has random function to generate.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647709#M193870</guid>
      <dc:creator>shursulei2</dc:creator>
      <dc:date>2020-05-14T07:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: ranuni</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647712#M193873</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/326226"&gt;@shursulei2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code below ,&amp;nbsp;The RAND function returns a random uniformly distributed number in the interval (0,1). It is then multiplied by 9 auto output a random integer in the range 1 to 9. NB: The CEILZ function r&lt;SPAN&gt;eturns the smallest integer that is greater than or equal to the argument.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is it what you are looking for?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;y= ceilz(9*rand('uniform'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data aa;
do i=1 to 100000000;
	y= ceilz(9*rand('uniform'));
	output;
end;
run;

proc freq;
	table y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture d’écran 2020-05-14 à 09.27.39.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39423i2C59F7F83B5EE32F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture d’écran 2020-05-14 à 09.27.39.png" alt="Capture d’écran 2020-05-14 à 09.27.39.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647712#M193873</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-05-14T07:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: ranuni</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647715#M193875</link>
      <description>&lt;P&gt;The newer (and better) &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0fpeei0opypg8n1b06qe4r040lv.htm&amp;amp;locale=en#p0i0papjdn73pzn1kxrjoyygmdfb" target="_blank" rel="noopener"&gt;RAND Function&lt;/A&gt; provides a specific type for this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;y = rand('integer',1,9);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 07:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ranuni/m-p/647715#M193875</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T07:34:50Z</dc:date>
    </item>
  </channel>
</rss>

