<?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: days count each month wise in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592581#M169927</link>
    <description>&lt;P&gt;My code should not take too long. No data is being read, only 12 rows created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For me to replicate the "correct" output, please post exactly what the correct output is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2019 08:19:04 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-09-30T08:19:04Z</dc:date>
    <item>
      <title>days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592559#M169916</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;                       
jan=intnx('month',01,0,'e');
feb=intnx('month',02,0,'e');
mar=intnx('month',03,0,'e');
apr=intnx('month',04,0,'e');
may=intnx('month',05,0,'e');
jun=intnx('month',06,0,'e');
jul=intnx('month',07,0,'e');
aug=intnx('month',08,0,'e');
sep=intnx('month',09,0,'e');
oct=intnx('month',10,0,'e');
nov=intnx('month',11,0,'e');
dec=intnx('month',12,0,'e');
run;    &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to count number of days each month wise&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;anand&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 04:33:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592559#M169916</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-09-30T04:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592566#M169919</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    do dt='01jan2019'd by 0 until (dt ge '31dec2019'd);
        dt=intnx('month', dt, 0, 'e');
        days=day(dt);
        output;
        dt=dt+1;
    end;
    format dt monname.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 05:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592566#M169919</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-30T05:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592576#M169924</link>
      <description>&lt;P&gt;Hi draycut&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code is running to long&amp;nbsp;&lt;/P&gt;&lt;P&gt;But&amp;nbsp; not correct output&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 07:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592576#M169924</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-09-30T07:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592581#M169927</link>
      <description>&lt;P&gt;My code should not take too long. No data is being read, only 12 rows created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For me to replicate the "correct" output, please post exactly what the correct output is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 08:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592581#M169927</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-30T08:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592595#M169933</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you mean something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  first_period = '1jan2018'd; 
  drop first_period;
  array Months jan feb mar apr may jun jul aug sep oct nov dec;

  do over Months; 
    Months = day(intnx('month',first_period, _i_-1, 'e'));
  end;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or a bit more general:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data first_period;
format first_period yymmdd10.;
first_period = '1jan2013'd; output;
first_period = '2feb2014'd; output;
first_period = '3mar2015'd; output;

first_period = '4apr2016'd; output;
first_period = '5may2017'd; output;
first_period = '6jun2018'd; output;

first_period = '7jul2019'd; output;
first_period = '8aug2020'd; output;
first_period = '9sep2021'd; output;

first_period = '10oct2022'd; output;
first_period = '11nov2023'd; output;
first_period = '12dec2024'd; output;
run;



data a;
  set first_period;
  array Months jan feb mar apr may jun jul aug sep oct nov dec;

  do over Months; 
    Months = day(intnx('month',first_period, _i_-month(first_period), 'e'));
  end;
run;  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 09:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592595#M169933</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2019-09-30T09:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592598#M169935</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi draycut&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code is running to long&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can't be,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;'s code takes just one hundredth of a second:&lt;/P&gt;
&lt;PRE&gt;73         data a;
 74             do dt='01jan2019'd by 0 until (dt ge '31dec2019'd);
 75                 dt=intnx('month', dt, 0, 'e');
 76                 days=day(dt);
 77                 output;
 78                 dt=dt+1;
 79             end;
 80             format dt monname.;
 81         run;
 
 NOTE: The data set WORK.A has 12 observations and 2 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.01 seconds
       cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;and the result looks fine to me:&lt;/P&gt;
&lt;PRE&gt;                                                     Beob.           dt    days

                                                        1       January     31 
                                                        2      February     28 
                                                        3         March     31 
                                                        4         April     30 
                                                        5           May     31 
                                                        6          June     30 
                                                        7          July     31 
                                                        8        August     31 
                                                        9     September     30 
                                                       10       October     31 
                                                       11      November     30 
                                                       12      December     31 

&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Sep 2019 09:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592598#M169935</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-30T09:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592604#M169940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763" target="_self"&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;Yabown&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your initiative&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 09:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592604#M169940</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-09-30T09:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: days count each month wise</title>
      <link>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592605#M169941</link>
      <description>&lt;P&gt;Hi Draycut&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just i reopen my sas application and check your solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's perfect output&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You for your support&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 09:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/days-count-each-month-wise/m-p/592605#M169941</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-09-30T09:41:21Z</dc:date>
    </item>
  </channel>
</rss>

