<?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: INTNX calendar slicing / monthly anniversary date and calendar date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453548#M114623</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data input;
input start_date: ddmmyy10. end_date: ddmmyy10.;
format start_date end_date ddmmyy10.;
datalines;
15/06/2008 31/12/2009
;
run;
data temp;
 set input;
 n+1;
 do date=start_date to end_date;
   month=month(date);output;
 end;
 format date ddmmyy10.;
 drop start_date end_date;
run;
proc sql;
create table want as
 select n,month,min(date) as start format=date9.,max(date) as end format=date9.
  from temp
   group by n,month;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Apr 2018 13:36:05 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-04-12T13:36:05Z</dc:date>
    <item>
      <title>INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453259#M114511</link>
      <description>&lt;P&gt;Hi everyone , any help on this topic ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the goal is to have a monthly calendar slicing with 2 column start and end date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here the code/example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; input;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; start_date: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; end_date: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; start_date end_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15/06/2008 31/12/2009&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; expected;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; input;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date_breaks &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;max_dur=intck(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, start_date ,end_date,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'continuous'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; max_dur;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;date_breaks=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, start_date,i,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'s'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15JUN2008&lt;/P&gt;&lt;P&gt;15JUL2008&lt;/P&gt;&lt;P&gt;15AUG2008&lt;/P&gt;&lt;P&gt;15SEP2008&lt;/P&gt;&lt;P&gt;15OCT2008&lt;/P&gt;&lt;P&gt;15NOV2008&lt;/P&gt;&lt;P&gt;15DEC2008&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the goal is to have :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;15JUN2008 &lt;STRONG&gt;30JUN2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;30JUN2008&lt;/STRONG&gt;&amp;nbsp; 15JUL2008&lt;/P&gt;&lt;P&gt;15JUL2008 &lt;STRONG&gt;31JUL2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;31JUL2008&amp;nbsp; &lt;/STRONG&gt;15AUG2008&lt;/P&gt;&lt;P&gt;&amp;nbsp;…&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453259#M114511</guid>
      <dc:creator>bebess</dc:creator>
      <dc:date>2018-04-11T15:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453264#M114514</link>
      <description>&lt;P&gt;So where you now have one variable (DATE_BREAKS), you actually need two variables.&amp;nbsp; Let's call them DATE_BREAK1 and DATE_BREAK2.&amp;nbsp; You can patch the result using what you have done so far:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set expected;&lt;/P&gt;
&lt;P&gt;if mod(_n_, 2) then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date_break1 = date_breaks;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date_break2 = intnx('month', date_breaks, 0, 'end');&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;else do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date_break2 = date_breaks;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; date_break1 = intnx('month', date_breaks, 0) - 1;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop date_breaks;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453264#M114514</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-11T15:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453268#M114518</link>
      <description>&lt;P&gt;The rules are not very clear -&lt;/P&gt;
&lt;P&gt;&amp;nbsp; -&amp;nbsp; can start date be on and day in month, not only the 15th?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; -&amp;nbsp; if positive with day will be the next break&amp;nbsp; &amp;nbsp;start_day +15&amp;nbsp; &amp;nbsp;or always end of month ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the specific case you can try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set input;  /* geting the start_date and the end_date of calendar */

       break_date = start_date;

  do while (break_date &amp;lt; end_date);
       if day(break_date) = 15 then 
                end_date = intnx('month', break_date, 0 ,'e');
        else end_date = break_date + 15;
        output;
        break_date = end_date;
  end;
run;
        
                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:45:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453268#M114518</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-11T15:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453270#M114520</link>
      <description>&lt;P&gt;thanks for you support , i have tested what i really want using you suggestion but i don't have the result expected ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a second anniversary date corresponding to the birthday ( month slicing) ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; input;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; birth_date: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; start_date: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; end_date: &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; birth_date start_date end_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;06/07/2008 15/06/2008 31/12/2010&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; expected;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; input;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date_breaks &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;max_dur=intck(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, start_date ,end_date,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'continuous'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; max_dur;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;date_breaks=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, start_date,i,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'s'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;date_breaks=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, birth_date,i,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'s'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; i ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; want;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; expected;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date_break1 date_break2 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; mod(_n_, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date_break1 = date_breaks;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;date_break2 = intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, date_breaks, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'end'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date_break2 = date_breaks;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;date_break1 = intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, date_breaks, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;) - &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*drop date_breaks;*/&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;the result i have : &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;15/06/2008&amp;nbsp;30/06/2008&lt;BR /&gt;30/06/2008&amp;nbsp;06/07/2008&lt;BR /&gt;15/07/2008&amp;nbsp;31/07/2008&lt;BR /&gt;31/07/2008&amp;nbsp;06/08/2008&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;but i want :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;15/06/2008&amp;nbsp;30/06/2008&lt;BR /&gt;30/06/2008&amp;nbsp;06/07/2008&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;06/07/2008 15/07/2008&lt;BR /&gt;15/07/2008 31/07/2008&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;31/07/2008&lt;/FONT&gt;&amp;nbsp;&amp;nbsp; &lt;FONT face="Courier New" size="3"&gt;06/08/2008&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;could you explain me this part of the code : &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt; mod(_n_, &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;) &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Many thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 15:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453270#M114520</guid>
      <dc:creator>bebess</dc:creator>
      <dc:date>2018-04-11T15:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453274#M114523</link>
      <description>strat day can be any date&lt;BR /&gt;the goal is to split by any anniversary dates the month and always have end of month.&lt;BR /&gt;&lt;BR /&gt;for example 15/month/year and 20/month/year&lt;BR /&gt;i always want :&lt;BR /&gt;start date / end date from the begining of each month until the 15 then 15 to 20 and finally 20 to the end of month .</description>
      <pubDate>Wed, 11 Apr 2018 15:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453274#M114523</guid>
      <dc:creator>bebess</dc:creator>
      <dc:date>2018-04-11T15:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453278#M114526</link>
      <description>&lt;P&gt;I'm not sure I understand your example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As day can be any day in a month, slight change need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set input;  /* geting the start_date and the end_date of calendar */
       retain  dayx;
       dayx = day(start_date);
       break_date = start_date;

  do while (break_date &amp;lt; end_date);
       if day(break_date) = dayx then 
                end_date = intnx('month', break_date, 0 ,'e');
        else end_date = break_date + 15;
        output;
        break_date = end_date;
  end;
run;
     &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;run the code and in case of issue please post output example and the required result.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 16:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453278#M114526</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-11T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453279#M114527</link>
      <description>&lt;P&gt;The MOD function divides the first number by the second number, and returns the remainder.&amp;nbsp; So this DO statement executes on every other observation, starting with the first one.&amp;nbsp; (The ELSE statement executes for the even-numbered observations.)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 16:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453279#M114527</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-11T16:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: INTNX calendar slicing / monthly anniversary date and calendar date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453548#M114623</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data input;
input start_date: ddmmyy10. end_date: ddmmyy10.;
format start_date end_date ddmmyy10.;
datalines;
15/06/2008 31/12/2009
;
run;
data temp;
 set input;
 n+1;
 do date=start_date to end_date;
   month=month(date);output;
 end;
 format date ddmmyy10.;
 drop start_date end_date;
run;
proc sql;
create table want as
 select n,month,min(date) as start format=date9.,max(date) as end format=date9.
  from temp
   group by n,month;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 13:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INTNX-calendar-slicing-monthly-anniversary-date-and-calendar/m-p/453548#M114623</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-04-12T13:36:05Z</dc:date>
    </item>
  </channel>
</rss>

