<?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: Splitting one row with multiple ages into multiple rows with one age each in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571890#M12237</link>
    <description>&lt;P&gt;Simple do loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
do age = age_first to age_last;
  output;
end;
keep age rate;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 08 Jul 2019 19:53:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-07-08T19:53:38Z</dc:date>
    <item>
      <title>Splitting one row with multiple ages into multiple rows with one age each</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571888#M12235</link>
      <description>&lt;P&gt;I have a large dataset where each rate is the same for all ages between age_first and age_last. Below is an example of one row of the dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;age_first&amp;nbsp; &amp;nbsp;age_last&amp;nbsp; &amp;nbsp;rate&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to convert this row into many, with one row for each age, like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;age&amp;nbsp; &amp;nbsp;rate&lt;/P&gt;&lt;P&gt;15&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;16&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;17&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;18&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;19&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;&lt;P&gt;20&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 19:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571888#M12235</guid>
      <dc:creator>rav31</dc:creator>
      <dc:date>2019-07-08T19:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one row with multiple ages into multiple rows with one age each</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571889#M12236</link>
      <description>&lt;P&gt;Use those values as the do loop start and stop.&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 age=age_first to age_list;
       output; *writes a record for each age;
end;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/280837"&gt;@rav31&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a large dataset where each rate is the same for all ages between age_first and age_last. Below is an example of one row of the dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;age_first&amp;nbsp; &amp;nbsp;age_last&amp;nbsp; &amp;nbsp;rate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is to convert this row into many, with one row for each age, like so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;age&amp;nbsp; &amp;nbsp;rate&lt;/P&gt;
&lt;P&gt;15&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;16&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;17&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;18&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;19&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; &amp;nbsp; &amp;nbsp;4.16&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2019 19:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571889#M12236</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-08T19:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting one row with multiple ages into multiple rows with one age each</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571890#M12237</link>
      <description>&lt;P&gt;Simple do loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
do age = age_first to age_last;
  output;
end;
keep age rate;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jul 2019 19:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-one-row-with-multiple-ages-into-multiple-rows-with-one/m-p/571890#M12237</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-08T19:53:38Z</dc:date>
    </item>
  </channel>
</rss>

