<?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: Merge / Append two differnt columns into one column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217264#M40017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use merge or update statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2015 16:45:19 GMT</pubDate>
    <dc:creator>slchen</dc:creator>
    <dc:date>2015-05-19T16:45:19Z</dc:date>
    <item>
      <title>Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217262#M40015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two columns listed below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="149" style="border: 1px solid rgb(0, 0, 0); width: 74px; height: 148px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid rgb(0, 0, 0); width: 68px; height: 35px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to create something like this below..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" style="border: 1px solid rgb(0, 0, 0); width: 67px; height: 170px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I do this in SAS data step?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 16:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217262#M40015</guid>
      <dc:creator>JUN_Sands</dc:creator>
      <dc:date>2015-05-19T16:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217263#M40016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the two sets are sorted by the Header variable:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge dataset1 dataset2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by Header1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are combining sets with more variables with the same name then the order the datasets appear on the Merge statement become an issue as will if the BY variable has repeated values in both datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 16:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217263#M40016</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-19T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217264#M40017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use merge or update statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 16:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217264#M40017</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-05-19T16:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217265#M40018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should have mentioned that two columns have different labels. Do I need to change them to same column name before merge them?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217265#M40018</guid>
      <dc:creator>JUN_Sands</dc:creator>
      <dc:date>2015-05-19T17:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217266#M40019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Union will eliminate the duplicates and you can sort in the same step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have1;&lt;/P&gt;&lt;P&gt;infile cards dsd dlm=',';&lt;/P&gt;&lt;P&gt;input header;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&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;data have2;&lt;/P&gt;&lt;P&gt;infile cards dsd dlm=',';&lt;/P&gt;&lt;P&gt;input header;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;5&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;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select header from have1&lt;/P&gt;&lt;P&gt;union&lt;/P&gt;&lt;P&gt;select header from have2&lt;/P&gt;&lt;P&gt;order by header;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217266#M40019</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-19T17:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217267#M40020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I was doing this using datastep I would do the following:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have1 have2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=want nodup;by header;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217267#M40020</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-19T17:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217268#M40021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;update have1 have2;&lt;/P&gt;&lt;P&gt;by header;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update can get a little trickier.&amp;nbsp; You might want to read up on that to get a better understanding if you use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217268#M40021</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-19T17:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217269#M40022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to rename, using either way will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;update have1 have2(rename=(header_two=header));&lt;/P&gt;&lt;P&gt;by header;&lt;/P&gt;&lt;P&gt;run;&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 header from have1&lt;/P&gt;&lt;P&gt;union&lt;/P&gt;&lt;P&gt;select header_two as header from have2&lt;/P&gt;&lt;P&gt;order by header;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217269#M40022</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-05-19T17:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merge / Append two differnt columns into one column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217270#M40023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have any doubt add a label statement to the code. By default variable characteristics such as Label or Format will be the one associated with the first listed data set for those items common to more than one set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2015 17:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-Append-two-differnt-columns-into-one-column/m-p/217270#M40023</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-19T17:31:44Z</dc:date>
    </item>
  </channel>
</rss>

