<?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 Combine (Interleave) two columns, keeping all other columns, too in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281868#M59138</link>
    <description>&lt;P&gt;Please see the following data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Bob Paul 120
Tina Adele 111
Scott Joe 100
Betty Trish 97
Mark Adam 95
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Three columns: Name#1, Name#2, Score.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to join the columns to produce the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Bob 120
Paul 120
Tina 111
Adele 111
Scott 100
Joe 100
Betty 97
Trish 97
Mark 95
Adam 95
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Two columns: Name#1 OR Name#2, Score&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done efficiently?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Jul 2016 00:05:39 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2016-07-03T00:05:39Z</dc:date>
    <item>
      <title>Combine (Interleave) two columns, keeping all other columns, too</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281868#M59138</link>
      <description>&lt;P&gt;Please see the following data set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Bob Paul 120
Tina Adele 111
Scott Joe 100
Betty Trish 97
Mark Adam 95
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Three columns: Name#1, Name#2, Score.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to join the columns to produce the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Bob 120
Paul 120
Tina 111
Adele 111
Scott 100
Joe 100
Betty 97
Trish 97
Mark 95
Adam 95
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Two columns: Name#1 OR Name#2, Score&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can this be done efficiently?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2016 00:05:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281868#M59138</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-07-03T00:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combine (Interleave) two columns, keeping all other columns, too</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281869#M59139</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want(keep=Name score);&lt;BR /&gt;set have;&lt;BR /&gt;array n(*) name1 name2;&lt;BR /&gt;do i=1 to dim(n);&lt;BR /&gt; Name=n(i);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2016 00:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281869#M59139</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2016-07-03T00:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combine (Interleave) two columns, keeping all other columns, too</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281871#M59141</link>
      <description>&lt;P&gt;Another way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
do name = name1, name2;
    output;
    end;
drop name1 name2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Jul 2016 01:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281871#M59141</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-07-03T01:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Combine (Interleave) two columns, keeping all other columns, too</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281873#M59142</link>
      <description>&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;set have (rename=name1=name keep=(name score))&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Have (rename=name2=name keep=(name score));&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to play with the keep statement. I never remember if you reference a renamed variable with the original or new name in the keep section.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jul 2016 02:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combine-Interleave-two-columns-keeping-all-other-columns-too/m-p/281873#M59142</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-03T02:31:55Z</dc:date>
    </item>
  </channel>
</rss>

