<?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 join two tables ignore the missing values on joining in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17741#M2590</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; if i do the sort by where no not missinf the some records will be removed as i am having 10 million records in each table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Feb 2012 10:28:46 GMT</pubDate>
    <dc:creator>sas_Forum</dc:creator>
    <dc:date>2012-02-29T10:28:46Z</dc:date>
    <item>
      <title>join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17739#M2588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want to join two tables based two variables but i should not consider balnk values&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data table1;&lt;BR /&gt;input id no;&lt;BR /&gt;cards;&lt;BR /&gt;6 1&lt;BR /&gt;5 .&lt;BR /&gt;5 .&lt;BR /&gt;7 2&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data table2;&lt;BR /&gt;input id no;&lt;BR /&gt;cards;&lt;BR /&gt;1 1&lt;BR /&gt;2 .&lt;BR /&gt;3 .&lt;BR /&gt;4 2&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;i want&amp;nbsp; to join both table on no variable with no missing values(.) how can i do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 08:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17739#M2588</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-02-29T08:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17740#M2589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand your question that you want to join by the "no" variable and exclude missing values then you want something like...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*By putting the where statement in the proc sort then the sorted tables will not have any missing values for the merge;&lt;/P&gt;&lt;P&gt;proc sort data=table1 out=table1Sorted;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by no;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where no is not missing;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=table2 out=table2Sorted;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by no;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where no is not missing;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*This will get what you want if it is a one to one or one to many type of merge. If it is many to many rows then replace the data step with SQL;&lt;/P&gt;&lt;P&gt;data newTable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge table1Sorted(rename=(id=id1)) table2Sorted(rename=(id=id2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by no;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Depending on your data and if you have many to many records then you may want to do the join using SQL...;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table newTable as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select t1.id as id1, t1.no, t2,id as id2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from table1Sorted as t1, table2Sorted as t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where t1.no=t2.no&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 09:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17740#M2589</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2012-02-29T09:08:35Z</dc:date>
    </item>
    <item>
      <title>join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17741#M2590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; if i do the sort by where no not missinf the some records will be removed as i am having 10 million records in each table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 10:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17741#M2590</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-02-29T10:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17742#M2591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I interprete your requirement correct then below SQL should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp; create table want as*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select l.no as l_no,r.no as r_no, l.id as l_id, r.id as r_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from table1 l full outer join table2 r&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on l.no=r.no and l.no not is null and r.no not is null&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would help a lot if you could show us how the required result table should look like.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 10:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17742#M2591</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-02-29T10:43:00Z</dc:date>
    </item>
    <item>
      <title>join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17743#M2592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table new2 as select * from table1 as a left join table2 as &lt;BR /&gt;b on a.no=b.no and a.no is not null and b.no is not null;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tnqs&lt;/P&gt;&lt;P&gt;yesterday i used&amp;nbsp;&amp;nbsp; a.no is not null and not used b.no is not null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 10:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17743#M2592</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-02-29T10:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17744#M2593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Patrick said, if you are able to show what you want your joined table to look like that would help. We can then have a better understanding of your requirement and assist with the code. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 12:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17744#M2593</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2012-02-29T12:25:57Z</dc:date>
    </item>
    <item>
      <title>join two tables ignore the missing values on joining</title>
      <link>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17745#M2594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thqs Michelle and patrick for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 12:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/join-two-tables-ignore-the-missing-values-on-joining/m-p/17745#M2594</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-02-29T12:30:29Z</dc:date>
    </item>
  </channel>
</rss>

