<?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: Add dummy values to column in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569555#M11836</link>
    <description>rand table is old, 9.2 or 9.1 I think so would work here.</description>
    <pubDate>Thu, 27 Jun 2019 17:46:15 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-06-27T17:46:15Z</dc:date>
    <item>
      <title>Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569496#M11824</link>
      <description>&lt;P&gt;I have a dataset with 3000 records. One of the variables is blank for now,but we expect values in next refresh. How to add dummy values with no specific order and also the count of each value is not main concern.&lt;/P&gt;&lt;P&gt;for example&amp;nbsp;variable_reqd&amp;nbsp; is blank in dataset "have" . But the variable need to have values&amp;nbsp; 'a','b','c','d' in "want" for all 3000 rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569496#M11824</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-06-27T15:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569497#M11825</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
array r{4} _temporary_ ('a','b','c','d');
variable_reqd = r{rand('integer',1,4)};
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569497#M11825</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T15:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569521#M11828</link>
      <description>&lt;P&gt;There is an ERROR reported:&lt;/P&gt;&lt;P&gt;ERROR: Attempt to initialize element of numeric array r with&lt;BR /&gt;character constant 'a'.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569521#M11828</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-06-27T16:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569526#M11829</link>
      <description>&lt;P&gt;My bad. Add a dollar sign to the array statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array r{4} $ _temporary_ ('a','b','c','d');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569526#M11829</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569527#M11830</link>
      <description>&lt;P&gt;I tried that before reaching out. But still the below error is reported:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;5553 array r{4} $ _temporary_ ('a','b','c','d');&lt;BR /&gt;5554 variable_reqd = r{rand('integer',1,4)};&lt;BR /&gt;5555 run;&lt;/P&gt;&lt;P&gt;ERROR: The first argument of the RAND function must be a&lt;BR /&gt;character string with a value of BERNOULLI, BETA,&lt;BR /&gt;BINOMIAL, CAUCHY, CHISQUARE, ERLANG, EXPONENTIAL, F,&lt;BR /&gt;GAMMA, GAUSSIAN, GEOMETRIC, HYPERGEOMETRIC, LOGNORMAL,&lt;BR /&gt;NEGB, NORMAL, POISSON, T, TABLE, TRIANGULAR, UNIFORM, or&lt;BR /&gt;WEIBULL.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569527#M11830</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-06-27T16:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569529#M11831</link>
      <description>You're likely on a version of SAS that doesn't have the integer option for rand yet. What is your SAS version?&lt;BR /&gt;&lt;BR /&gt;Rick Wicklin has a macro on his blog to replicate the function.</description>
      <pubDate>Thu, 27 Jun 2019 16:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569529#M11831</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-27T16:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569532#M11832</link>
      <description>&lt;P&gt;SAS version:9.04.01M3P062415&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569532#M11832</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2019-06-27T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569533#M11833</link>
      <description>array r{0:3} $ _temporary_ ('a','b','c','d');&lt;BR /&gt;variable_reqd = r(mod(_n_, 4);&lt;BR /&gt;&lt;BR /&gt;If it doesn't matter where they go, just loop them.</description>
      <pubDate>Thu, 27 Jun 2019 16:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569533#M11833</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-27T16:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569536#M11834</link>
      <description>&lt;P&gt;Then you need to use the uniform distribution with a little additional work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;r{floor(rand('uniform')*4)+1}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Edit: changed normal to uniform&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569536#M11834</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T16:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569550#M11835</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Then you need to use the uniform distribution with a little additional work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;r{floor(rand('uniform')*4)+1}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="1"&gt;Edit: changed normal to uniform&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;or r[rand('table',.25,.25,.25,.25)} might work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't remember which version introduced the rand('table').&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 17:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569550#M11835</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-27T17:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Add dummy values to column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569555#M11836</link>
      <description>rand table is old, 9.2 or 9.1 I think so would work here.</description>
      <pubDate>Thu, 27 Jun 2019 17:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-dummy-values-to-column/m-p/569555#M11836</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-27T17:46:15Z</dc:date>
    </item>
  </channel>
</rss>

