<?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 Matching in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91756#M19371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are two files Master and Target:&lt;/P&gt;&lt;P&gt;Master has id1 and id2 and flag fields.&lt;BR /&gt;id1 is a 16 digit number &lt;BR /&gt;id2 is a 18 digit number&lt;BR /&gt;flag is a 1 digit number&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Target has id1 and id2 fields.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now we need output for the following conditions:&lt;BR /&gt;if id1 in both datasets are equal &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;if id2 match (i.e all 18 digits)&lt;BR /&gt;or if first tweleve digits and last five digits of id2 in both files match &lt;BR /&gt;or if first tweleve digits of id2 match and flag is equal to 1 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 May 2013 18:15:31 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2013-05-31T18:15:31Z</dc:date>
    <item>
      <title>Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91756#M19371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are two files Master and Target:&lt;/P&gt;&lt;P&gt;Master has id1 and id2 and flag fields.&lt;BR /&gt;id1 is a 16 digit number &lt;BR /&gt;id2 is a 18 digit number&lt;BR /&gt;flag is a 1 digit number&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Target has id1 and id2 fields.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now we need output for the following conditions:&lt;BR /&gt;if id1 in both datasets are equal &lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;if id2 match (i.e all 18 digits)&lt;BR /&gt;or if first tweleve digits and last five digits of id2 in both files match &lt;BR /&gt;or if first tweleve digits of id2 match and flag is equal to 1 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 18:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91756#M19371</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-05-31T18:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91757#M19372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to store ID2 as CHARACTER because floating point numbers cannot accurately store 18 digits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;create table want as &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;select *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from master(rename=(id1=master_id1 id2=master_id2)) m&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , target(rename=(id1=target_id1 id=target_id2)) t&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;where master_id1 = target_id1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; or master_id2 = target_id2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp; or (substr(master_id2,1,12) = substr(target_id2,1,12)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and (substr(master_id2,14) = substr(target_id2,14)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or m.flag = 1 )&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 19:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91757#M19372</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-31T19:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91758#M19373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 15:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Matching/m-p/91758#M19373</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2013-06-06T15:25:20Z</dc:date>
    </item>
  </channel>
</rss>

