<?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 Merging data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38837#M7828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two datasets as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dataset A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;tom&lt;/P&gt;&lt;P&gt;Emily&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dataset B&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;67&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to merge these datasets to get the following dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datasetC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;John 34&lt;/P&gt;&lt;P&gt;John 54&lt;/P&gt;&lt;P&gt;John 67&lt;/P&gt;&lt;P&gt;Tom 34&lt;/P&gt;&lt;P&gt;Tom 54&lt;/P&gt;&lt;P&gt;Tom 67&lt;/P&gt;&lt;P&gt;Emily 34&lt;/P&gt;&lt;P&gt;Emily 54&lt;/P&gt;&lt;P&gt;Emily 67&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this? Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2012 14:59:16 GMT</pubDate>
    <dc:creator>bkoksal</dc:creator>
    <dc:date>2012-01-26T14:59:16Z</dc:date>
    <item>
      <title>Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38837#M7828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two datasets as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dataset A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;tom&lt;/P&gt;&lt;P&gt;Emily&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dataset B&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;67&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to merge these datasets to get the following dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datasetC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;name id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;John 34&lt;/P&gt;&lt;P&gt;John 54&lt;/P&gt;&lt;P&gt;John 67&lt;/P&gt;&lt;P&gt;Tom 34&lt;/P&gt;&lt;P&gt;Tom 54&lt;/P&gt;&lt;P&gt;Tom 67&lt;/P&gt;&lt;P&gt;Emily 34&lt;/P&gt;&lt;P&gt;Emily 54&lt;/P&gt;&lt;P&gt;Emily 67&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this? Thanks for any help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38837#M7828</guid>
      <dc:creator>bkoksal</dc:creator>
      <dc:date>2012-01-26T14:59:16Z</dc:date>
    </item>
    <item>
      <title>Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38838#M7829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just join without conditons, SQL will automatically do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;infile cards;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Emily&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data have2;&lt;/P&gt;&lt;P&gt;infile cards;&lt;/P&gt;&lt;P&gt;input id;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;67&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from have1&lt;/P&gt;&lt;P&gt;full join&lt;/P&gt;&lt;P&gt;have2 on 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 15:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38838#M7829</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-01-26T15:08:29Z</dc:date>
    </item>
    <item>
      <title>Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38839#M7830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; another way:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; id &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; :ids&amp;nbsp; separated &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;','&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; _n_=&amp;amp;ids;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;id=_n_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 15:35:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38839#M7830</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-26T15:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38840#M7831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; &lt;/SPAN&gt;A slightly more straightforward FROM Clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from have1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cross join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;have2&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 15:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38840#M7831</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2012-01-26T15:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38841#M7832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if you are really keen on using datastep and don't mind flagging _error_ variable, here is another way :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; Courier New&amp;amp;quot: ; color: navy; font-size: 10pt; background-color: white; font-family: &amp;amp;quot;"&gt;data&lt;/STRONG&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;set &lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;have1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;n=&lt;/SPAN&gt;&lt;STRONG style=": ; Courier New&amp;amp;quot: ; color: teal; font-size: 10pt; background-color: white; font-family: &amp;amp;quot;"&gt;0&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;do &lt;/SPAN&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt; (&lt;/SPAN&gt;&lt;STRONG style=": ; Courier New&amp;amp;quot: ; color: teal; font-size: 10pt; background-color: white; font-family: &amp;amp;quot;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;n+&lt;/SPAN&gt;&lt;STRONG style=": ; Courier New&amp;amp;quot: ; color: teal; font-size: 10pt; background-color: white; font-family: &amp;amp;quot;"&gt;1&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;set &lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;have2 point=n ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: black; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;_error_ &lt;/SPAN&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;leave&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;output&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; background-color: white; font-family: &amp;amp;quot;Courier New&amp;amp;quot;; font-size: 10pt;"&gt;end&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; Courier New&amp;amp;quot: ; color: navy; font-size: 10pt; background-color: white; font-family: &amp;amp;quot;"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 17:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38841#M7832</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-01-26T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38842#M7833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you Haikuo!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; name $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;john&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;tom&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Emily&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;34&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;54&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;67&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have2 point=i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _n_=i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 13:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38842#M7833</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-27T13:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38843#M7834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can eliminate the hardcoded 3 by using the NOBS option on the second SET statement.&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&lt;STRONG style="background-color: white; font-size: 10pt; color: navy; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; have1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="background-color: white; font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; by 1 until (i=nobs)&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; have2 point=i nobs=nobs;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&lt;STRONG style="background-color: white; font-size: 10pt; color: navy; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 14:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38843#M7834</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-01-27T14:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38844#M7835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice. Thank you Tom.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 14:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38844#M7835</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-27T14:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38845#M7836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&amp;nbsp; Tom's code is definitely better than flagging _error_. Tom's code can also be further simplified&amp;nbsp; by removing 'by 1 until':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to nobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have2 point=i nobs=nobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2012 19:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38845#M7836</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-01-27T19:00:43Z</dc:date>
    </item>
    <item>
      <title>Merging data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38846#M7837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/*Dataset A*/&lt;/P&gt;&lt;P&gt;data A;&lt;/P&gt;&lt;P&gt;input name $;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;tom&lt;/P&gt;&lt;P&gt;emily&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/*Dataset B*/&lt;/P&gt;&lt;P&gt;data B;&lt;/P&gt;&lt;P&gt;input ID;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;54&lt;/P&gt;&lt;P&gt;67&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; /*using cross join to perform one-to-many match*/&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table C as select * from A,B;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;/*print the dataset C*/&lt;/P&gt;&lt;P&gt;proc print data=C;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishnu&lt;/P&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2012 14:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-data-sets/m-p/38846#M7837</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2012-01-28T14:09:32Z</dc:date>
    </item>
  </channel>
</rss>

