<?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: Adding another row based on conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335487#M75935</link>
    <description>&lt;P&gt;Here you go:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data schedule;
 input firmid startdate mmddyy10. unit times amount;
 attrib startdate length=4 format=date9.;
 datalines;
1 01/15/2012 12 3 1000
1 03/15/2013 12 1 2000
1 01/30/2011 3 4 500
2 02/05/2015 6 2 1000
;
run;

data want;
set schedule;
output;
do i = 1 to times - 1;
   startdate = intnx('month', startdate, unit, 's');
   output;
   end;
keep firmid startdate amount;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2017 02:22:43 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2017-02-24T02:22:43Z</dc:date>
    <item>
      <title>Adding another row based on conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335484#M75932</link>
      <description>&lt;P&gt;I want to add another row based on the value.&lt;/P&gt;&lt;P&gt;In the data below, for the first observation, for example, for firm 1, starting from 15-JAN-2012, for every 12 month, for 3 times, I need to give $1000. For observation 4, for firm 2, starting from 05-FEB-2015, every 6 month, for two times, I need to give firm $1000. (I just put two firms for brevity)&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7426i0B1C567E05090BE7/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture1.PNG" title="Capture1.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;data schedule;&lt;BR /&gt; input firmid startdate mmddyy10. unit times amount;&lt;BR /&gt; datalines;&lt;BR /&gt;1 01/15/2012 12 3 1000&lt;BR /&gt;1 03/15/2013 12 1 2000&lt;BR /&gt;1 01/30/2011 3 4 500&lt;BR /&gt;2 02/05/2015 6 2 1000&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=schedule;&lt;BR /&gt;format startdate date11.;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;In the end, I need a table that looks like below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7427iE31F534ECC281BDF/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture2.PNG" title="Capture2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Could you please help me creating this table?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 02:13:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335484#M75932</guid>
      <dc:creator>Sangho</dc:creator>
      <dc:date>2017-02-24T02:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Adding another row based on conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335487#M75935</link>
      <description>&lt;P&gt;Here you go:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data schedule;
 input firmid startdate mmddyy10. unit times amount;
 attrib startdate length=4 format=date9.;
 datalines;
1 01/15/2012 12 3 1000
1 03/15/2013 12 1 2000
1 01/30/2011 3 4 500
2 02/05/2015 6 2 1000
;
run;

data want;
set schedule;
output;
do i = 1 to times - 1;
   startdate = intnx('month', startdate, unit, 's');
   output;
   end;
keep firmid startdate amount;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2017 02:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335487#M75935</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-02-24T02:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding another row based on conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335488#M75936</link>
      <description>It works great! Thank you so much.</description>
      <pubDate>Fri, 24 Feb 2017 02:53:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-another-row-based-on-conditions/m-p/335488#M75936</guid>
      <dc:creator>Sangho</dc:creator>
      <dc:date>2017-02-24T02:53:48Z</dc:date>
    </item>
  </channel>
</rss>

