<?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 Splitting one row to multiple rows in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-row-to-multiple-rows/m-p/25192#M5688</link>
    <description>I need to split one row in a dataset to multiple rows.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
Initial dataset:&lt;BR /&gt;
a   b   ccc  d   1000   2000   1500  x&lt;BR /&gt;
e   f    ggg  k   3000   4000   7000  y&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Final dataset:&lt;BR /&gt;
a   b   ccc  d   1000                      x1&lt;BR /&gt;
a   b   ccc  d             2000            x2&lt;BR /&gt;
a   b   ccc  d                       1500  x3&lt;BR /&gt;
e   f    ggg  k   3000                      y1&lt;BR /&gt;
e   f    ggg  k             4000            y2&lt;BR /&gt;
e   f    ggg  k                       7000  y3&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
How can i do?&lt;BR /&gt;
Thanks&lt;BR /&gt;
MPaola</description>
    <pubDate>Wed, 09 Mar 2011 08:42:18 GMT</pubDate>
    <dc:creator>MPaola</dc:creator>
    <dc:date>2011-03-09T08:42:18Z</dc:date>
    <item>
      <title>Splitting one row to multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-row-to-multiple-rows/m-p/25192#M5688</link>
      <description>I need to split one row in a dataset to multiple rows.&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
Initial dataset:&lt;BR /&gt;
a   b   ccc  d   1000   2000   1500  x&lt;BR /&gt;
e   f    ggg  k   3000   4000   7000  y&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Final dataset:&lt;BR /&gt;
a   b   ccc  d   1000                      x1&lt;BR /&gt;
a   b   ccc  d             2000            x2&lt;BR /&gt;
a   b   ccc  d                       1500  x3&lt;BR /&gt;
e   f    ggg  k   3000                      y1&lt;BR /&gt;
e   f    ggg  k             4000            y2&lt;BR /&gt;
e   f    ggg  k                       7000  y3&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
How can i do?&lt;BR /&gt;
Thanks&lt;BR /&gt;
MPaola</description>
      <pubDate>Wed, 09 Mar 2011 08:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-row-to-multiple-rows/m-p/25192#M5688</guid>
      <dc:creator>MPaola</dc:creator>
      <dc:date>2011-03-09T08:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one row to multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-row-to-multiple-rows/m-p/25193#M5689</link>
      <description>[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
input a $ b $ c $ d $ e f g h $;&lt;BR /&gt;
cards;&lt;BR /&gt;
a b ccc d 1000 2000 1500 x&lt;BR /&gt;
e f ggg k 3000 4000 7000 y&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data result;&lt;BR /&gt;
 set temp;&lt;BR /&gt;
 array x{*} e--g;&lt;BR /&gt;
 do i=1 to dim(x);&lt;BR /&gt;
  _x=x{i};_h=cats(h,i);&lt;BR /&gt;
  output;&lt;BR /&gt;
 end;&lt;BR /&gt;
 drop i e--g h;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 09 Mar 2011 09:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Splitting-one-row-to-multiple-rows/m-p/25193#M5689</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-03-09T09:54:30Z</dc:date>
    </item>
  </channel>
</rss>

