<?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: how to append different column within the same dataset in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319485#M1652</link>
    <description>&lt;P&gt;Or simply:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have (rename=(weight01=weight))
      have (rename=(weight02=weight))
      have (rename=(weight03=weight));
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Dec 2016 10:09:58 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-12-16T10:09:58Z</dc:date>
    <item>
      <title>how to append different column within the same dataset</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319471#M1648</link>
      <description>&lt;P&gt;origin file&amp;nbsp;&lt;/P&gt;&lt;P&gt;group &amp;nbsp; weight01 weight02 &amp;nbsp;weight03 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A &amp;nbsp; 1 2 3&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp;4 5 6&amp;nbsp;&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp;7 8 9&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp;6 5 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I woul like to&lt;/P&gt;&lt;P&gt;group &amp;nbsp; weight&lt;/P&gt;&lt;P&gt;&amp;nbsp;A 1&lt;/P&gt;&lt;P&gt;A 4&lt;/P&gt;&lt;P&gt;B 7&lt;/P&gt;&lt;P&gt;B 6&lt;/P&gt;&lt;P&gt;A 2&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;B 8&lt;/P&gt;&lt;P&gt;B 5&lt;/P&gt;&lt;P&gt;A 3&lt;/P&gt;&lt;P&gt;A 6&lt;/P&gt;&lt;P&gt;B 9&lt;/P&gt;&lt;P&gt;B 4&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 08:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319471#M1648</guid>
      <dc:creator>miris</dc:creator>
      <dc:date>2016-12-16T08:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to append different column within the same dataset</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319474#M1649</link>
      <description>&lt;P&gt;I think I find the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is folowing logic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc sql;
create table allvars as 
select var1 from dataset
union
select var2 from dataset
union
select var3 from dataset;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 08:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319474#M1649</guid>
      <dc:creator>miris</dc:creator>
      <dc:date>2016-12-16T08:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to append different column within the same dataset</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319476#M1650</link>
      <description>&lt;P&gt;Explicit method in a data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
array weights {*} weight01-weight03;
do i = 1 to dim(weights);
  weight = weights{i};
  output;
end;
keep group weight;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 09:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319476#M1650</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-16T09:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to append different column within the same dataset</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319478#M1651</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/119440"&gt;@miris&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I think I find the answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it is folowing logic&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;proc sql;
create table allvars as 
select var1 from dataset
union
select var2 from dataset
union
select var3 from dataset;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Correct version (giving exactly the output you initially posted):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table allvars as 
select group, weight01 as weight from have
union all
select group, weight02 as weight from have
union all
select group, weight03 as weight from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 09:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319478#M1651</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-16T09:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to append different column within the same dataset</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319485#M1652</link>
      <description>&lt;P&gt;Or simply:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have (rename=(weight01=weight))
      have (rename=(weight02=weight))
      have (rename=(weight03=weight));
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Dec 2016 10:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-append-different-column-within-the-same-dataset/m-p/319485#M1652</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-16T10:09:58Z</dc:date>
    </item>
  </channel>
</rss>

