<?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: Creating new rows of observation from the new range of date in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814276#M34147</link>
    <description>&lt;P&gt;Use a DO loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
do year = year(subscription_start_date) to year(subscription_end_date);
  output;
end;
keep user_id year subscription;
run;

proc sort data=want;
by user_id descending year;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 May 2022 12:38:44 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-05-19T12:38:44Z</dc:date>
    <item>
      <title>Creating new rows of observation from the new range of date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814273#M34146</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OJohn_StaT_0-1652960160309.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71630i0D61F00AAB5E55A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OJohn_StaT_0-1652960160309.png" alt="OJohn_StaT_0-1652960160309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This observation above is one of thousands of observations in my dataset. Member name JD25654 has a subscription between these dates. Using this data, I want to make a new dataset like the following dataset. Subscription dates of each member are changing. Some of them have been members for 10 years, some of them have been a member for 1 year. I tried ways like lagging etc, but I couldn't get this dataset I need. Could you help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="OJohn_StaT_0-1652961262041.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71632iBBE4147B46E950C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="OJohn_StaT_0-1652961262041.png" alt="OJohn_StaT_0-1652961262041.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 11:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814273#M34146</guid>
      <dc:creator>OJohn_StaT</dc:creator>
      <dc:date>2022-05-19T11:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new rows of observation from the new range of date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814276#M34147</link>
      <description>&lt;P&gt;Use a DO loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
do year = year(subscription_start_date) to year(subscription_end_date);
  output;
end;
keep user_id year subscription;
run;

proc sort data=want;
by user_id descending year;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2022 12:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814276#M34147</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-05-19T12:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new rows of observation from the new range of date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814277#M34148</link>
      <description>&lt;P&gt;Thank you so much for your time and your contribution!&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 12:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-new-rows-of-observation-from-the-new-range-of-date/m-p/814277#M34148</guid>
      <dc:creator>OJohn_StaT</dc:creator>
      <dc:date>2022-05-19T12:47:54Z</dc:date>
    </item>
  </channel>
</rss>

