<?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: create multiple rows from single row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918058#M361647</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389348"&gt;@Feyng819&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1xno5xgs39b70n0zydov0owajj8.htm" target="_blank" rel="noopener"&gt;PROC TRANSPOSE&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(drop=_: rename=(col1=score) where=(score&amp;gt;.));
by name notsorted;
var score:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Feb 2024 16:15:46 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-02-27T16:15:46Z</dc:date>
    <item>
      <title>create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918054#M361644</link>
      <description>Hi I would like to ask that how can I create multiple rows from single row data:&lt;BR /&gt;Let’s say I have the following data:&lt;BR /&gt;Data have;&lt;BR /&gt;Input name$ score1 score2 score3 score4 score5;&lt;BR /&gt;Cards;&lt;BR /&gt;Leo 1 1 3 3 5&lt;BR /&gt;Sean 3 4 . . .&lt;BR /&gt;Nathan 4 5 7 . .&lt;BR /&gt;; run;&lt;BR /&gt;&lt;BR /&gt;This is what I want;&lt;BR /&gt;Data want;&lt;BR /&gt;Input name$ score;&lt;BR /&gt;Leo 1&lt;BR /&gt;Leo 1&lt;BR /&gt;Leo 3&lt;BR /&gt;Leo 3&lt;BR /&gt;Leo 5&lt;BR /&gt;Sean 3&lt;BR /&gt;Sean 4&lt;BR /&gt;Nathan 4&lt;BR /&gt;Nathan 5&lt;BR /&gt;Nathan 7&lt;BR /&gt;;run;&lt;BR /&gt;I was trying to use loop function but couldn’t figure it out.. thanks for your help in advance</description>
      <pubDate>Tue, 27 Feb 2024 16:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918054#M361644</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-27T16:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918057#M361646</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    array s score1-score5;
    do i=1 to dim(s);
        score=s(i);
        output;
    end;
    drop i score1-score5;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918057#M361646</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-27T16:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918058#M361647</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389348"&gt;@Feyng819&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1xno5xgs39b70n0zydov0owajj8.htm" target="_blank" rel="noopener"&gt;PROC TRANSPOSE&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(drop=_: rename=(col1=score) where=(score&amp;gt;.));
by name notsorted;
var score:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918058#M361647</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-27T16:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918059#M361648</link>
      <description>&lt;P&gt;That is what PROC TRANSPOSE was made for.&lt;/P&gt;
&lt;P&gt;You can use RENAME= dataset option to change the name it assigns to the new variable to something more meaningful.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want(rename=(col1=SCORE) );
  by name;
  var score1-score5;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918059#M361648</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-27T16:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918060#M361649</link>
      <description>&lt;P&gt;No need to LOOP.&amp;nbsp; You can just write some wallpaper code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  score=score1;
  output;
  score=score2;
  output;
  .....
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can complete the pattern.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918060#M361649</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-27T16:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918061#M361650</link>
      <description>Thanks for your help! It works!</description>
      <pubDate>Tue, 27 Feb 2024 16:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918061#M361650</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-27T16:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918062#M361651</link>
      <description>Thanks a lot this also works for me</description>
      <pubDate>Tue, 27 Feb 2024 16:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918062#M361651</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-27T16:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: create multiple rows from single row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918063#M361652</link>
      <description>Thanks a lot!</description>
      <pubDate>Tue, 27 Feb 2024 16:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-multiple-rows-from-single-row/m-p/918063#M361652</guid>
      <dc:creator>Feyng819</dc:creator>
      <dc:date>2024-02-27T16:21:29Z</dc:date>
    </item>
  </channel>
</rss>

