<?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: assign a set of random numbers to a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568742#M160171</link>
    <description>&lt;P&gt;sorry, this is suppose to work for about 18,000 datasets that is why the do loop. it should output the results according to the given condition. so the results shouldn't only be the value 6&amp;nbsp; but values 0,1,2, 4, 5, 6, 7&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2019 13:21:49 GMT</pubDate>
    <dc:creator>Anita_n</dc:creator>
    <dc:date>2019-06-25T13:21:49Z</dc:date>
    <item>
      <title>assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568728#M160159</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have a problem, I hope I can get some help over here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am tring to assign&amp;nbsp; numbers&amp;nbsp; 0,1, 2, 4, 5, 6, 7 (pls note here values are without 3) to a variable y if this condition is fullfiled&lt;/P&gt;&lt;P&gt;if x="8000" and a="0" and y=" ". This schould take place in a data step&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following code but it tends to output y= " " . I don't know if my if else do condition is not working. I will be glad for any help&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

if x= "8000" and a="0" and y= " " then
   do;
      y=rand("integer" 0, 7);
      output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I know this code will include the value 3 which I don't want, is there any way I can exempt the value 3? Anyway the code is not working properly may some can help. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 12:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568728#M160159</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-25T12:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568730#M160161</link>
      <description>&lt;P&gt;Please post an example for dataset have. Is y character or numeric?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568730#M160161</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-25T13:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568732#M160163</link>
      <description>&lt;P&gt;y is a character&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:11:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568732#M160163</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-25T13:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568733#M160164</link>
      <description>&lt;P&gt;Use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;y=rand("integer",0, 6);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Upper limit being 6 instead of 7, then if a number 3 or larger is returned, add one to it. Y will be numeric, but you can change that if you wish.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568733#M160164</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-25T13:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568735#M160166</link>
      <description>&lt;P&gt;but I need the number 7 also. Pls the code is giving me missings for all y values. I dont know why.&lt;/P&gt;&lt;P&gt;Is there a mistake in my code?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568735#M160166</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-25T13:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568737#M160167</link>
      <description>&lt;P&gt;When 6 is the result from RAND and you add one to it (as I said earlier), you get 7.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:16:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568737#M160167</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-25T13:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568739#M160169</link>
      <description>This is not tested. So may not work but you can try.&lt;BR /&gt;After if then try the following.&lt;BR /&gt;Y=rand('integer',0,7);&lt;BR /&gt;Do while (Y=3);&lt;BR /&gt;Y=Rand('integer',0,7);&lt;BR /&gt;End;&lt;BR /&gt;Output;&lt;BR /&gt;End;&lt;BR /&gt;Run;</description>
      <pubDate>Tue, 25 Jun 2019 13:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568739#M160169</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-25T13:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568742#M160171</link>
      <description>&lt;P&gt;sorry, this is suppose to work for about 18,000 datasets that is why the do loop. it should output the results according to the given condition. so the results shouldn't only be the value 6&amp;nbsp; but values 0,1,2, 4, 5, 6, 7&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568742#M160171</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-25T13:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568746#M160172</link>
      <description>&lt;P&gt;ok let my try that&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568746#M160172</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-25T13:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568747#M160173</link>
      <description>&lt;P&gt;Here's the logic in detail&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want random numbers:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0, 1, 2, 4, 5, 6, 7&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However RAND('integer',0,6) produces random numbers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0, 1, 2, 3, 4, 5 , 6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is not what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then when you add 1 to values 3 and larger you get random numbers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0, 1, 2, 4, 5, 6, 7&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is exactly what you want&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568747#M160173</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-25T13:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568748#M160174</link>
      <description>&lt;P&gt;Create an array that holds your set of values, and use the random number as basis for an index into this array:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array rands{7} _temporary_ (0,1,2,4,5,6,7);
do i = 1 to 100;
  value = rands{floor(rand('uniform')*7)+1};
  output;
end;
keep value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568748#M160174</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-25T13:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568751#M160176</link>
      <description>Sorry there is an extra end after output. Please delete that</description>
      <pubDate>Tue, 25 Jun 2019 13:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568751#M160176</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-25T13:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568761#M160180</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168930"&gt;@Anita_n&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am tring to assign&amp;nbsp; numbers&amp;nbsp; 0,1, 2, 4, 5, 6, 7 (pls note here values are without 3) to a variable y (...)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;      y=rand("integer" 0, 7);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168930"&gt;@Anita_n&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The missing comma after "integer" is a syntax error. Since &lt;FONT face="courier new,courier"&gt;y&lt;/FONT&gt; is a character variable, you may want to calculate the numeric value (implementing&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s idea) using a temporary &lt;EM&gt;numeric&lt;/EM&gt; variable, say &lt;FONT face="courier new,courier"&gt;_n_&lt;/FONT&gt;, and then assign the result via PUT function as a character value to &lt;FONT face="courier new,courier"&gt;y&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;     _n_=rand('integer', 0, 6);
     y=put(_n_+(_n_&amp;gt;2),1.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Also, I recommend using the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0gw58qo85qp56n1kbpiz50ww8lv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;CALL STREAMINIT routine&lt;/A&gt; to define a seed value. Otherwise you can't replicate your results (from the RAND function).&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 13:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568761#M160180</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-06-25T13:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568775#M160185</link>
      <description>&lt;P&gt;Using character values for Y:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
array yvals {7} _temporary_ ('0' '1' '2' '4' '5' '6' '7');
if x= "8000" and a="0" and y= " " then
      y=yvals{ceil(ranuni(12345) * 7))};
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2019 14:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568775#M160185</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-25T14:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568833#M160211</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry I could not test the code (that I suggested) as I was away from my desktop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There have been very nice alternative solution in this post, using arrays. They are elegant codes and will work here. However, I am doing some cheap selling of my method here. Apologies for that but thought you should know. May be useful in some cases.&lt;/P&gt;&lt;P&gt;Suppose the problem becomes complex where you have to &lt;STRONG&gt;exclude "one" number&lt;/STRONG&gt; (say 3) from a &lt;STRONG&gt;large set of possible numbers&lt;/STRONG&gt; (say 1 to 1000), then creating an array of 1000 numbers could be a little time consuming and memory consuming. However if you you use a DO WHILE loop, it will work well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Supposing I want to create a Y column with random number ranging from 1 to 1000 but number 3 excluded, then I will write the below code.&lt;/P&gt;&lt;PRE&gt;DATA Number_3_Exluded_From_1_to_1000;
	SET sashelp.cars;
	Y=RAND('integer', 1, 1000);

	DO WHILE(Y=3);
		Y=RAND('integer', 1, 1000);
	END;
RUN;&lt;/PRE&gt;&lt;P&gt;When you run this code it has following CPU and memory footprints.&lt;/P&gt;&lt;PRE&gt; NOTE: There were 428 observations read from the data set SASHELP.CARS.
 NOTE: The data set WORK.NUMBER_3_EXLUDED_FROM_1_TO_1000 has 428 observations and 16 variables.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.01 seconds
       system cpu time     0.00 seconds
       memory              840.96k
       OS Memory           28584.00k
       Timestamp           06/25/2019 03:32:00 PM
       Step Count                        30  Switch Count  2
       Page Faults                       0
       Page Reclaims                     168
       Page Swaps                        0
       Voluntary Context Switches        10
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           264&lt;/PRE&gt;&lt;P&gt;The number 3 has been excluded from the column Y. You can check for that using a simple PROC SQL as below.&lt;/P&gt;&lt;PRE&gt;PROC SQL;
	SELECT Y 
	FROM Number_3_Exluded_From_1_to_1000 
	WHERE Y=3;
QUIT;&lt;/PRE&gt;&lt;P&gt;The log clearly says that no rows were selected as below.&lt;/P&gt;&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 70         
 71         PROC SQL;
 72         SELECT Y
 73         FROM Number_3_Exluded_From_1_to_1000
 74         WHERE Y=3;
 NOTE: No rows were selected.
 75         QUIT;&lt;/PRE&gt;&lt;P&gt;I might be wrong here and I am sure there is a more elegant solution to the problem I have stated above. I would love to learn something new on this.&lt;/P&gt;&lt;P&gt;So what I am suggesting to you is run the below code. Replace everything after the IF THEN statement (in your original post)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	Y=rand('integer', 0, 7);

	Do while (Y=3);
		Y=Rand('integer', 0, 7);
	End;
	Output;
RUN;&lt;/PRE&gt;&lt;P&gt;Best wishes.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 15:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568833#M160211</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-25T15:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568884#M160237</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212247"&gt;@koyelghosh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I might be wrong here and I am sure there is a more elegant solution to the problem I have stated above. I would love to learn something new on this.
&lt;P&gt;So what I am suggesting to you is run the below code. Replace everything after the IF THEN statement (in your original post)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	Y=rand('integer', 0, 7);

	Do while (Y=3);
		Y=Rand('integer', 0, 7);
	End;
	Output;
RUN;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have no doubt that this will work. However, it may execute a little longer than some of the other solutions, since 1/8th of the time, you will have to go through the DO WHILE loop, and 1/8 of those it will go through the DO WHILE loop a second time and so on. I don't remember the algebraic formula for the infinite sum of fractions + powers of those fractions like this, but in any event this will likely take about 13% longer than other solutions. If that doesn't bother you (and for small data sets it doesn't bother me, but for large data sets maybe that's an issue), then I consider this to be a valid solution.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568884#M160237</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-25T18:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568896#M160241</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212247"&gt;@koyelghosh&lt;/a&gt;: I think this technique (known as acceptance-rejection method) can be particularly useful in situations where the condition for rejection (here: y=3) is more complex so that it can't be replaced by a simple definition like&amp;nbsp;&lt;FONT face="courier new,courier"&gt;y=r+(r&amp;gt;=3);&lt;/FONT&gt; (with a suitable random number &lt;FONT face="courier new,courier"&gt;r&lt;/FONT&gt;) as in your example.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568896#M160241</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-06-25T18:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568989#M160272</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;@Thank you&lt;BR /&gt;You definitely have a valid argument against the suggested approach. However I was thinking, as the length of the set of numbers to choose from increases, the probability that the excluded number will appear will decrease. Thus in very few cases, it will actually enter the loop and spend time there.&lt;BR /&gt;However you are perfectly right that for small list (like 0 - 7) excluding 3 will have significant overhead in terms of time spent in the while loop.&lt;BR /&gt;May be I should do some simulation to try to guess big O of my suggested approach, for different length of set of numbers from which to exclude (a single number). Regardless, your post definitely makes me pause and think.&lt;BR /&gt;Thank you once again.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 04:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568989#M160272</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-26T04:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568994#M160275</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;Thanks a lot for your contributions. I tested all your suggestions and found out that all of them&lt;/P&gt;&lt;P&gt;gives me the desired output. It depends on which choice one prefers. I'm very greatfull for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my question is, is it possible to accept all this possibilities as a solution, since they all work??&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 07:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568994#M160275</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2019-06-26T07:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: assign a set of random numbers to a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568995#M160276</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168930"&gt;@Anita_n&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that the solutions worked for you. You could accept that suggestion as the solution which you eventually adopted, i.e. used in your code, and give likes to the other posts you found helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 07:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/assign-a-set-of-random-numbers-to-a-variable/m-p/568995#M160276</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-06-26T07:15:03Z</dc:date>
    </item>
  </channel>
</rss>

