<?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: How to create an identifier using first name, last name, and date of birth in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394217#M94969</link>
    <description>&lt;P&gt;Just add a compress:&lt;/P&gt;
&lt;PRE&gt; URN=compress(upcase(cats(substr(first_name,1,1),substr(first_name,3,1),substr(last_name,1,1),substr(last_name,3,1),put(dob,MMDDYY8.),put(Gender_forTLCmatch,1.),"U")),"/");&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Sep 2017 14:27:35 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-09-08T14:27:35Z</dc:date>
    <item>
      <title>How to create an identifier using first name, last name, and date of birth</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394199#M94962</link>
      <description>&lt;P&gt;I would like to create a variable from first name, last name, and date of birth that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First letter of first name + 3rd letter of first name + first letter of last name + 3rd letter of last name + DOB (mmddyy) + indicator of race (1-4) + Letter U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, for a person with this data:&lt;/P&gt;&lt;P&gt;First_name &amp;nbsp; &amp;nbsp;Last_name &amp;nbsp; DOB &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race&lt;/P&gt;&lt;P&gt;Sarah &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Smith &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09/01/1999 &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a variable that looks like this:&lt;/P&gt;&lt;P&gt;SRSI0901992U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 13:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394199#M94962</guid>
      <dc:creator>Kels123</dc:creator>
      <dc:date>2017-09-08T13:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an identifier using first name, last name, and date of birth</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394200#M94963</link>
      <description>&lt;P&gt;I would not recommend using data like that as an ID. &amp;nbsp;Data errors and other problems (not to mention possible duplicates) will render the ID useless. &amp;nbsp;It is technically possible:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length id $100;
  id=upcase(cats(substr(first_name,1,1),substr(first_name,3,1),put(dob,ddmmyy8.),put(race,1.),"U"));
run;&lt;/PRE&gt;
&lt;P&gt;But I really wouldn't recommend it.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 13:27:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394200#M94963</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-09-08T13:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an identifier using first name, last name, and date of birth</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394212#M94966</link>
      <description>&lt;P&gt;I agree that this identifier is sub-optimal, but unfortunately I need to do a datamatch with a database that only has this identifier available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One quick follow-up question: How do I remove the slashes from the identifier?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently using&amp;nbsp;this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; match.mydatabase3;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;set&lt;/SPAN&gt; match.mydatabase3;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;length&lt;/SPAN&gt; URN $&lt;SPAN class="s3"&gt;&lt;STRONG&gt;100&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;URN=upcase(cats(substr(first_name,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;),substr(first_name,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;),substr(last_name,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;),substr(last_name,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;),put(dob,&lt;SPAN class="s3"&gt;MMDDYY8.&lt;/SPAN&gt;),put(Gender_forTLCmatch,&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1.&lt;/STRONG&gt;&lt;/SPAN&gt;),&lt;SPAN class="s4"&gt;"U"&lt;/SPAN&gt;));&lt;/P&gt;&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s5"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s5"&gt;Which produces this: &amp;nbsp;&lt;/SPAN&gt;SRSI09/01/992U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of this (which is what I want): &amp;nbsp;SRSI0901992U&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394212#M94966</guid>
      <dc:creator>Kels123</dc:creator>
      <dc:date>2017-09-08T14:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an identifier using first name, last name, and date of birth</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394216#M94968</link>
      <description>&lt;P&gt;You didn't say what your real objective is. &amp;nbsp;Maybe this format is prescribed by someone else, and that's just the format you need.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;[Edit: now I see you're stuck with the format you asked for...but I'll leave this response for others who have a similar situation.]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt;, if the real goal is to anonymize these fields such that the personal info is obscured, yet the original value can be checked/verified against this encoded value, then you probably want to use a one-way hash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS supports an &lt;A href="http://blogs.sas.com/content/sasdummy/2014/01/18/sha256-function-sas94/" target="_self"&gt;industry-standard function (SHA256)&lt;/A&gt; that encrypts the value you supply. &amp;nbsp;Assuming you have the original fields stored off somewhere else in a more secure table, you can always re-connect that personal data with the encrypted data because the calculated hash will be the same. &amp;nbsp;But a person with just access to the hash value will not be able to determine the original value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;hash = sha256(cats(first_name,last_name,put(dob,ddmmyy8.)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394216#M94968</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2017-09-08T14:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an identifier using first name, last name, and date of birth</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394217#M94969</link>
      <description>&lt;P&gt;Just add a compress:&lt;/P&gt;
&lt;PRE&gt; URN=compress(upcase(cats(substr(first_name,1,1),substr(first_name,3,1),substr(last_name,1,1),substr(last_name,3,1),put(dob,MMDDYY8.),put(Gender_forTLCmatch,1.),"U")),"/");&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Sep 2017 14:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-an-identifier-using-first-name-last-name-and-date/m-p/394217#M94969</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-09-08T14:27:35Z</dc:date>
    </item>
  </channel>
</rss>

