<?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: Concatenate variables in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464203#M29971</link>
    <description>&lt;P&gt;Yes, please provide us a sample of your data, your output, the code you used and your log,&lt;/P&gt;&lt;P&gt;here is the test with my assumptions using your narrative:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;122 data test;&lt;BR /&gt;123 ssn='123456789';&lt;BR /&gt;124 dob='02jan1993'd;&lt;BR /&gt;125 if not missing(dob) then new_var=cats(ssn,put(dob,mmddyy10. -l));&lt;BR /&gt;126 else new_var=ssn;&lt;BR /&gt;127 put new_var=;&lt;BR /&gt;128 run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_var=12345678901/02/1993&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.TEST has 1 observations and 3 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;real time 0.01 seconds&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;cpu time 0.01 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2018 21:25:28 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-05-22T21:25:28Z</dc:date>
    <item>
      <title>Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464193#M29966</link>
      <description>&lt;P&gt;What is the best way to concatenate the following: I am trying to create a unique identifier to link two datasets. I am exploring the option of using SSN and DOB {not all observations have a valid SSN recorded; hence why I am adding DOB. DOB is currently in the MMDDYY10. format. SSN is currently in character format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to concatenate these two variables into a unique identifier, eliminating blanks and without distorting the date information?&lt;/P&gt;&lt;P&gt;Also, how does this handle missing data (say if a DOB is missing)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 20:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464193#M29966</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2018-05-22T20:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464195#M29967</link>
      <description>&lt;P&gt;are you after&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if not missing(dob) then new_var=cats(ssn,put(dob,mmddyy10. -l));

else new_var=ssn;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464195#M29967</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-22T21:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464199#M29969</link>
      <description>&lt;P&gt;Hi there... so that code did not do anything for the unique id (it simply outputted the ssn without the dob included).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally if someone's SSN is 123456789 and their DOB is 01/02/1993 - then the uniqueID would be: 12345678901021993.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that make sense?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464199#M29969</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2018-05-22T21:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464201#M29970</link>
      <description>&lt;P&gt;Can you post the exact code you used please and some sample records. Since you don't provide sample data, the solutions are untested, of course.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:21:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464201#M29970</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-22T21:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464203#M29971</link>
      <description>&lt;P&gt;Yes, please provide us a sample of your data, your output, the code you used and your log,&lt;/P&gt;&lt;P&gt;here is the test with my assumptions using your narrative:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;122 data test;&lt;BR /&gt;123 ssn='123456789';&lt;BR /&gt;124 dob='02jan1993'd;&lt;BR /&gt;125 if not missing(dob) then new_var=cats(ssn,put(dob,mmddyy10. -l));&lt;BR /&gt;126 else new_var=ssn;&lt;BR /&gt;127 put new_var=;&lt;BR /&gt;128 run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_var=12345678901/02/1993&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: The data set WORK.TEST has 1 observations and 3 variables.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;real time 0.01 seconds&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;cpu time 0.01 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464203#M29971</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-22T21:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464204#M29972</link>
      <description>&lt;P&gt;And to remove the forward '/'&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
ssn='123456789';
dob='02jan1993'd;
if not missing(dob) then new_var=cats(ssn,compress(put(dob,mmddyy10. -l),'/'));
else new_var=ssn;
put new_var=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 May 2018 21:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464204#M29972</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-22T21:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464211#M29974</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;mmddyy10 -&amp;gt; 10 implies dashes, 8 would not include dashes, so try mmddyy8. instead perhaps?&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464211#M29974</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-22T21:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464214#M29975</link>
      <description>&lt;P&gt;Looks like a had a slight typo when I first tried it. This worked for me!&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464214#M29975</guid>
      <dc:creator>Krysia24</dc:creator>
      <dc:date>2018-05-22T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464219#M29976</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Love your attention to detail.. Caffeine effect after 6 cups of large pike at Starbucks on student discount &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Thank you though&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 21:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464219#M29976</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-22T21:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate variables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464230#M29979</link>
      <description>&lt;P&gt;One thought to consider: You might want to include something like an underscore between the ssn portion and the date portion.&lt;/P&gt;
&lt;P&gt;123456789_01021993&lt;/P&gt;
&lt;P&gt;might be easier to identify the date part when humans need to fix something like a short SSN. Also if the SSN is missing then a value like&lt;/P&gt;
&lt;P&gt;_11021993 tells you right away the SSN is completely missing where&lt;/P&gt;
&lt;P&gt;11011993 could be confused with an incomplete SSN and a missing DOB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 22:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-variables/m-p/464230#M29979</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-22T22:27:48Z</dc:date>
    </item>
  </channel>
</rss>

