<?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: Add X days to each subsequent each row, by group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398181#M96272</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112197"&gt;@pamplemouse22&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This works beautifully! Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to understand how this works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does the carrot in following line do?&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;flag&lt;SPAN class="token operator"&gt;^=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;^=&amp;nbsp;&amp;nbsp; is "not equal" . There are some other ways depending on different keyboards/operating systems that are also acceptable.&lt;/P&gt;
&lt;P&gt;so&lt;/P&gt;
&lt;P&gt;Flag not equal to 1&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2017 17:03:20 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-09-22T17:03:20Z</dc:date>
    <item>
      <title>Add X days to each subsequent each row, by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/397981#M96223</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stuck on a data management task and thought someone here may be able to help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with a dataset&amp;nbsp;where each individual has ~30 rows of repeated data. The variables&amp;nbsp;with information that differs are dates and a variable that indicates the first for each group. I'd like to add 7&amp;nbsp;number of days to every row, by&amp;nbsp;group.&amp;nbsp;I have a start date for the first row for each individual and need to add 7 days to each row until the next individual is reached (e.g., row 31) where the same process is repeated. Any suggestions? Here is what I have and what i want the data to look like. Thank you!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data have; 
	input id date first;
	datalines;
	1 03OCT2010 1
	1         . 0
	1         . 0
	1         . 0
	2 01JAN2011 1
	2         . 0
	2         . 0
	;
run; 

data want; 
	input id date first;
	datalines; 
	1 03OCT2010 1
	1 10OCT2010 0
	1 17OCT2010 0
	1 24OCT2010 0
	2 01JAN2011 1
 	2 08JAN2011 0
	2 15JAN2011 0
	;
run; &lt;/PRE&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>Fri, 22 Sep 2017 04:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/397981#M96223</guid>
      <dc:creator>pamplemouse22</dc:creator>
      <dc:date>2017-09-22T04:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Add X days to each subsequent each row, by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/397989#M96225</link>
      <description>&lt;P&gt;As long as FLAG=1 for the first record of each id, this will work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  retain tmpdate 0;
  tmpdate=ifn(flag=1,date,tmpdate+7);
  if flag^=1 then date=tmpdate;
  drop tmpdate;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Sep 2017 05:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/397989#M96225</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-22T05:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add X days to each subsequent each row, by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398139#M96259</link>
      <description>&lt;P&gt;This works beautifully! Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to understand how this works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does the carrot in following line do?&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;flag&lt;SPAN class="token operator"&gt;^=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 15:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398139#M96259</guid>
      <dc:creator>pamplemouse22</dc:creator>
      <dc:date>2017-09-22T15:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add X days to each subsequent each row, by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398181#M96272</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112197"&gt;@pamplemouse22&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This works beautifully! Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to understand how this works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does the carrot in following line do?&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;flag&lt;SPAN class="token operator"&gt;^=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;^=&amp;nbsp;&amp;nbsp; is "not equal" . There are some other ways depending on different keyboards/operating systems that are also acceptable.&lt;/P&gt;
&lt;P&gt;so&lt;/P&gt;
&lt;P&gt;Flag not equal to 1&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398181#M96272</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-22T17:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add X days to each subsequent each row, by group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398183#M96274</link>
      <description>&lt;P&gt;oh, hah! that makes sense. thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 17:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-X-days-to-each-subsequent-each-row-by-group/m-p/398183#M96274</guid>
      <dc:creator>pamplemouse22</dc:creator>
      <dc:date>2017-09-22T17:04:51Z</dc:date>
    </item>
  </channel>
</rss>

