<?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: Increment by months in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523521#M142235</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set now;
 do Countmonth=0 to 12;
   EvntMonth =EventDate;
   AccMonth=intnx('month',EventDate,Countmonth);
   RealMonth =month(AccMonth);
   format EvntMonth AccMonth yymmn6. ;
   output;
 end;
run;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Dec 2018 06:25:49 GMT</pubDate>
    <dc:creator>ShiroAmada</dc:creator>
    <dc:date>2018-12-26T06:25:49Z</dc:date>
    <item>
      <title>Increment by months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523520#M142234</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below I have data now for 2 firms.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data now;
input ticker $ EventDate EvntMonth;
datalines;

AA 09262013 9
ADI 11192012 11
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create data like this (below demonstration ignore the second firms and the other 4 years after the AA's event date). The row will be added to five years after the event date for EACH firm. Please help to show me how I can do that. I am appreciated your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input ticker $ EventDate EvntMonth RealMonth countmonth AccMonth;
datalines;
AA 09262013 092013 9 0 092013
AA 09262013 092013 10 1 102013
AA 09262013 092013 11 2 112013 
AA 09262013 092013 12 3 122013
AA 09262013 092013 1 4 012014
AA 09262013 092013 2 5 022014
AA 09262013 092013 3 6 032014
AA 09262013 092013 4 7 042014
AA 09262013 092013 5 8 022014
AA 09262013 092013 6 9 022014
AA 09262013 092013 7 10 022014
AA 09262013 092013 8 11 082014
AA 09262013 092013 9 12 022014
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I look for the solution and find that Reeza used macro do loop for increment months as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loop;

%do i=1 %to 12;

%let date=%sysfunc(intnx(month, %sysfunc(today()), &amp;amp;i.), date9.);

%put &amp;amp;date.;

%end;

%mend;

%loop;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I do not know how to apply it to my case. Please help me! thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 06:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523520#M142234</guid>
      <dc:creator>LucyDang</dc:creator>
      <dc:date>2018-12-26T06:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Increment by months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523521#M142235</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set now;
 do Countmonth=0 to 12;
   EvntMonth =EventDate;
   AccMonth=intnx('month',EventDate,Countmonth);
   RealMonth =month(AccMonth);
   format EvntMonth AccMonth yymmn6. ;
   output;
 end;
run;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Dec 2018 06:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523521#M142235</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2018-12-26T06:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Increment by months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523522#M142236</link>
      <description>&lt;P&gt;Hi ShiroAmanda, I'm appreciated your quick response! This works perfectly in my case!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 06:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increment-by-months/m-p/523522#M142236</guid>
      <dc:creator>LucyDang</dc:creator>
      <dc:date>2018-12-26T06:51:45Z</dc:date>
    </item>
  </channel>
</rss>

