<?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 Merge tables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513392#M2517</link>
    <description>&lt;P&gt;Hello I want to merge the two tables below&amp;nbsp;&lt;/P&gt;&lt;P&gt;A00 falls in the range A00-A09 therefore I need to add the range A00-A09 and the description column to the table 1 with 3500 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I do that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 (3,500 rows)&lt;/P&gt;&lt;P&gt;A00 Desc column&lt;/P&gt;&lt;P&gt;A01 Desc&lt;/P&gt;&lt;P&gt;A02 Desc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 (293 rows)&lt;/P&gt;&lt;P&gt;A00-A09 Shortname&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Nov 2018 16:08:43 GMT</pubDate>
    <dc:creator>Ranjeeta</dc:creator>
    <dc:date>2018-11-15T16:08:43Z</dc:date>
    <item>
      <title>Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513392#M2517</link>
      <description>&lt;P&gt;Hello I want to merge the two tables below&amp;nbsp;&lt;/P&gt;&lt;P&gt;A00 falls in the range A00-A09 therefore I need to add the range A00-A09 and the description column to the table 1 with 3500 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I do that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 (3,500 rows)&lt;/P&gt;&lt;P&gt;A00 Desc column&lt;/P&gt;&lt;P&gt;A01 Desc&lt;/P&gt;&lt;P&gt;A02 Desc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 (293 rows)&lt;/P&gt;&lt;P&gt;A00-A09 Shortname&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513392#M2517</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-15T16:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513398#M2520</link>
      <description>You need to provide more representative data otherwise you're likely going to get an answer that won't scale to your full data set.</description>
      <pubDate>Thu, 15 Nov 2018 16:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513398#M2520</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-15T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513399#M2521</link>
      <description>&lt;P&gt;Does the data have one or two variables here? Please be more specific about what your data looks like&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513399#M2521</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-11-15T16:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513403#M2522</link>
      <description>&lt;P&gt;Post test data in the form of a datastep please.&amp;nbsp; As such this is just a guess:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as
  select a.*,
         b.shortname
  from   table1 a
  left join table2 b
  on     char(a.code,1)=char(b.code,1)
  an     input(substr(scan(b.code,1,"-"),2),best.)&amp;lt;=input(substr(a.code,2),best.)&amp;lt;=input(substr(scan(b.code,2,"-"),2),best.);
quit;&lt;/PRE&gt;
&lt;P&gt;So effectively I am saying where the first character of code match and the numeric parts&amp;nbsp;code is between the numeric part of left hand table2 code and right part of table 2 code.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/513403#M2522</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-15T16:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515643#M2960</link>
      <description>&lt;P&gt;Thankyou for your response I resolved the same&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 19:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515643#M2960</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-23T19:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515644#M2961</link>
      <description>Thankyou its resolved</description>
      <pubDate>Fri, 23 Nov 2018 19:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515644#M2961</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2018-11-23T19:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Merge tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515669#M2963</link>
      <description>Please mark the question as solved, by marking the appropriate response or posting the solution that you found.</description>
      <pubDate>Fri, 23 Nov 2018 21:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Merge-tables/m-p/515669#M2963</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-23T21:41:21Z</dc:date>
    </item>
  </channel>
</rss>

