<?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: Need help on generating random consistent first names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179754#M302844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The names can be assigned it's original value so long the percentage of such names are insignificant. Also, the names don't have to be meaningful names. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2014 17:04:11 GMT</pubDate>
    <dc:creator>sas_null_</dc:creator>
    <dc:date>2014-11-20T17:04:11Z</dc:date>
    <item>
      <title>Need help on generating random consistent first names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179752#M302842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a task that I need to accomplish. I have FirstName that I need to either switch around or assign random names to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstName&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;John&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Joseph&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Charles&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Charles&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;John&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;John&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Mary&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;John&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstName (randomized) (Note: These are just random names)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Water&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Salt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Salt&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Mark&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Bill&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal is to assign consistent random names or switch the characters around using a logic. This logic must however generate consistent translation. For instance, in the above dataset, all occurrences of &lt;STRONG&gt;John&lt;/STRONG&gt; and &lt;STRONG&gt;Charles&lt;/STRONG&gt; must be translated to &lt;STRONG&gt;Bill (or any name generated by your code)&lt;/STRONG&gt; and &lt;STRONG&gt;Salt &lt;STRONG&gt;(or any name generated by your code)&lt;/STRONG&gt;&lt;/STRONG&gt; respectively as with the random test data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and I look forward to hearing from you all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 16:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179752#M302842</guid>
      <dc:creator>sas_null_</dc:creator>
      <dc:date>2014-11-20T16:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on generating random consistent first names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179753#M302843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does your "randomization" require that no name have a chance of being assigned it's original value?&lt;/P&gt;&lt;P&gt;If not this is one approach that scrambles the names without introducing any new words. The smaller the number of unique names the larger the chance that one or more of the names will be assigned it's original value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data start;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input Name $;&lt;BR /&gt;datalines;&lt;BR /&gt;John&lt;BR /&gt;Joseph&lt;BR /&gt;Charles&lt;BR /&gt;Charles&lt;BR /&gt;John&lt;BR /&gt;John&lt;BR /&gt;Mary&lt;BR /&gt;John&lt;BR /&gt;Fred&lt;BR /&gt;Lincoln&lt;BR /&gt;George&lt;BR /&gt;June&lt;BR /&gt;April&lt;BR /&gt;Leticia&lt;BR /&gt;Summer&lt;BR /&gt;Marge&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; create table uniquenames as&lt;BR /&gt;&amp;nbsp;&amp;nbsp; select distinct Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp; from start;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data temp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set uniquenames;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; order=_n_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rand = ranuni(123);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=temp out=temp2; by rand;run;&lt;/P&gt;&lt;P&gt;data cntldata;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; merge &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp2 (rename=(name=NewName) drop=order)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; fmtname = "Rename";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; start=Name;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; label = NewName;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; type='C';&lt;BR /&gt;run;&lt;BR /&gt;proc format library=work cntlin=cntldata;run;&lt;/P&gt;&lt;P&gt;proc print data=start;&lt;BR /&gt;var name;&lt;BR /&gt;format name $rename.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: you could use the format $rename to either actually change the value in a data step:&lt;/P&gt;&lt;P&gt;name = put(name,$rename.);&lt;/P&gt;&lt;P&gt;or create a new variable&lt;/P&gt;&lt;P&gt;RandName = put(name,$rename.);&lt;/P&gt;&lt;P&gt;or neither and just associate the format when using the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 16:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179753#M302843</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-11-20T16:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on generating random consistent first names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179754#M302844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The names can be assigned it's original value so long the percentage of such names are insignificant. Also, the names don't have to be meaningful names. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 17:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-generating-random-consistent-first-names/m-p/179754#M302844</guid>
      <dc:creator>sas_null_</dc:creator>
      <dc:date>2014-11-20T17:04:11Z</dc:date>
    </item>
  </channel>
</rss>

