<?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: Merging datasets without using MERGE statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25247#M4367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, You can use the proc sql statement to join your two tables.&lt;/P&gt;&lt;P&gt;the inner join is the match join. You'll need your id in the two tables to have it as output.&lt;/P&gt;&lt;P&gt;the left or right join permitts to join a source table with an other and one of the tables is used as reference.&lt;/P&gt;&lt;P&gt;the full join just tries to match your two tables. it's the less used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Jul 2011 05:54:52 GMT</pubDate>
    <dc:creator>mojerry2</dc:creator>
    <dc:date>2011-07-05T05:54:52Z</dc:date>
    <item>
      <title>Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25244#M4364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any method to merge two datasets without using MERGE statement . it might be simple question . but as I am new to SAS , Please provide the information . thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jul 2011 14:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25244#M4364</guid>
      <dc:creator>kaushiklu</dc:creator>
      <dc:date>2011-07-03T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25245#M4365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use proc sql using inner join instead of merge statement...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jul 2011 19:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25245#M4365</guid>
      <dc:creator>Ankitsas</dc:creator>
      <dc:date>2011-07-03T19:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25246#M4366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends on what you are trying to do.&amp;nbsp; Does the following approximate what you are calling merging?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input x;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data two;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input y $;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data both;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set two;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2011 18:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25246#M4366</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-04T18:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25247#M4367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, You can use the proc sql statement to join your two tables.&lt;/P&gt;&lt;P&gt;the inner join is the match join. You'll need your id in the two tables to have it as output.&lt;/P&gt;&lt;P&gt;the left or right join permitts to join a source table with an other and one of the tables is used as reference.&lt;/P&gt;&lt;P&gt;the full join just tries to match your two tables. it's the less used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jul 2011 05:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25247#M4367</guid>
      <dc:creator>mojerry2</dc:creator>
      <dc:date>2011-07-05T05:54:52Z</dc:date>
    </item>
    <item>
      <title>Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25248#M4368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; when you want to merge data, and since MERGE is obvious, why would you resist using it ? ^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 14:14:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25248#M4368</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-07-11T14:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Merging datasets without using MERGE statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25249#M4369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are lot of methods available for merging 2 datasets. But which method you use is based on the type of data and number of observation it has.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. &lt;SPAN style="font-family: courier new,courier;"&gt;PROC SQL;&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; SELECT VAR1,VAR2,T1.VAR3,VAR4,VAR5&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; FROM TABLE1 AS T1,TABLE2 AS T2&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; WHERE T1.VAR3=T2.VAR1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PROC SQL itself there are many methods available (Inner Join, Left Join, Right Join) and apart from that you can use SET operators (EXCEPT,INTERCEPT, UNION) to merge datasets. (But each one serve different purpose).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. SET statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: courier new,courier;"&gt;DATA dataset-name;&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; SET sas-dataset;&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; SET sas-dataset;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: courier new,courier;"&gt;DATA dataset-name;&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; SET sas-dataset;&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; SET sas-dataset KEY=index-name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you specify the index name in the KEY=option, processing changes from sequential to direct access, and SAS reads only the observation that satisfies the lookup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhanasekaran R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 13:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-datasets-without-using-MERGE-statement/m-p/25249#M4369</guid>
      <dc:creator>dhana</dc:creator>
      <dc:date>2011-07-12T13:40:55Z</dc:date>
    </item>
  </channel>
</rss>

