<?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 Random id for same mother in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252841#M6830</link>
    <description>&lt;DIV class="lia-quilt-column lia-quilt-column-04 lia-quilt-column-left lia-quilt-column-main-left"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;
&lt;DIV class="lia-message-author lia-component-author"&gt;
&lt;DIV class="lia-message-author-rank"&gt;Hello,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;
&lt;DIV id="messagebodydisplay_0" class="lia-message-body"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to assign a random id to mothers in a dataset for 4 years. Of course there are many mothers who give birth more than once in this dataset so I will like to use the same random id if that is the case. I have close to 200,000 records and a key using last name, first name and DOB of the mothers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 26 Feb 2016 21:48:09 GMT</pubDate>
    <dc:creator>malena</dc:creator>
    <dc:date>2016-02-26T21:48:09Z</dc:date>
    <item>
      <title>Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252838#M6822</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to assign a random id to mothers in a dataset for 4 years. Of course there are many mothers who give birth more than once in this dataset so I will like to use the same random id if that is the case. I have close to 200,000 records and a key using last name, first name and DOB of the mothers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 21:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252838#M6822</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2016-02-26T21:41:11Z</dc:date>
    </item>
    <item>
      <title>Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252841#M6830</link>
      <description>&lt;DIV class="lia-quilt-column lia-quilt-column-04 lia-quilt-column-left lia-quilt-column-main-left"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;
&lt;DIV class="lia-message-author lia-component-author"&gt;
&lt;DIV class="lia-message-author-rank"&gt;Hello,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-right lia-quilt-column-main-right"&gt;
&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-right"&gt;
&lt;DIV id="messagebodydisplay_0" class="lia-message-body"&gt;
&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to assign a random id to mothers in a dataset for 4 years. Of course there are many mothers who give birth more than once in this dataset so I will like to use the same random id if that is the case. I have close to 200,000 records and a key using last name, first name and DOB of the mothers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks!&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 Feb 2016 21:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252841#M6830</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2016-02-26T21:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252859#M6831</link>
      <description>What will be the use of the random id?</description>
      <pubDate>Fri, 26 Feb 2016 22:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252859#M6831</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-26T22:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252887#M6832</link>
      <description>&lt;P&gt;People frequently use UUIDs for this. Check out the UUIDGEN function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2016 03:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252887#M6832</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2016-02-27T03:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252888#M6833</link>
      <description>&lt;P&gt;To get random ids going from 1 to the number of distinct mothers, do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=mothers; by lastName firstName dob; run;

data mothers2;
call streaminit(7568);
retain id;
set mothers; by lastName firstName dob;
if first.dob then id = rand("UNIFORM");
run;

proc rank data=mothers2 out=mothersId ties=dense;
var id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2016 03:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252888#M6833</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-27T03:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252890#M6834</link>
      <description>&lt;P&gt;Hash Table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input first $ last $ dob : date9.;
format dob date9.;
cards;
a b 03jun1991
b c 09jan1980
b c 09jan1980
a b 03jun1991
;
run;
data want;
 if _n_=1 then do;
  if 0 then set have;
  declare hash h();
  h.definekey('first','last','dob');
  h.definedata('id');
  h.definedone();
 end;
 set have;
 rc=h.find();
 if rc ne 0 then do;n+1;id=n;h.add();end;
 drop rc n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Feb 2016 03:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252890#M6834</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-27T03:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252896#M6835</link>
      <description>&lt;P&gt;Or, if you just want large non repeating numbers as ids :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=mothers; by lastName firstName dob; run;

data mothersId;
call streaminit(7566);
retain id;
set mothers; by lastName firstName dob;
if first.dob then id = int(1e12*rand("UNIFORM"));
format id z12.0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 27 Feb 2016 04:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252896#M6835</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-27T04:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252903#M6838</link>
      <description>Not knowing the use case, but perhaps hashing the concatenated business key values could be one solution. &lt;BR /&gt;The id values will distributed, it's quite safe if privacy is required and it's simple to use: given the same input always  the same hash is produced. Check out the md5() function.</description>
      <pubDate>Sat, 27 Feb 2016 06:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252903#M6838</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-27T06:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252955#M6840</link>
      <description>&lt;P&gt;Hashing isn't a good idea...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New York Taxi Open Data - Reversed Engineered&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.theguardian.com/technology/2014/jun/27/new-york-taxi-details-anonymised-data-researchers-warn" target="_blank"&gt;http://www.theguardian.com/technology/2014/jun/27/new-york-taxi-details-anonymised-data-researchers-warn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2016 18:23:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/252955#M6840</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-27T18:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Random id for same mother</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/253188#M6861</link>
      <description>&lt;P&gt;thank you! this works perfectly&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 14:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Random-id-for-same-mother/m-p/253188#M6861</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2016-02-29T14:27:21Z</dc:date>
    </item>
  </channel>
</rss>

