<?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 Count months from date to the end of the year in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631937#M18954</link>
    <description>&lt;P&gt;Hi, I'd like to see a number of months left from the date to the end of the year.&lt;/P&gt;&lt;P&gt;I know to count month I can use intck('month', 'start', 'end', 'D') but how to get the "end" date when it's not given. I dont know how to pass the 'end' argument. Only what I got is the start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to see:&lt;/P&gt;&lt;P&gt;date&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;months&lt;/P&gt;&lt;P&gt;01JUN2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;01APR2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 15:52:22 GMT</pubDate>
    <dc:creator>PatrykSAS</dc:creator>
    <dc:date>2020-03-13T15:52:22Z</dc:date>
    <item>
      <title>Count months from date to the end of the year</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631937#M18954</link>
      <description>&lt;P&gt;Hi, I'd like to see a number of months left from the date to the end of the year.&lt;/P&gt;&lt;P&gt;I know to count month I can use intck('month', 'start', 'end', 'D') but how to get the "end" date when it's not given. I dont know how to pass the 'end' argument. Only what I got is the start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to see:&lt;/P&gt;&lt;P&gt;date&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;months&lt;/P&gt;&lt;P&gt;01JUN2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;01APR2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 15:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631937#M18954</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2020-03-13T15:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count months from date to the end of the year</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631942#M18955</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input date :date9. ;* months;
format date date9.;
cards;
01JUN2019                7
01APR2020                9
;

data want;
 set have;
 Months=intck('mon',date,intnx('year',date,0,'e'))+1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 15:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631942#M18955</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-03-13T15:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Count months from date to the end of the year</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631943#M18956</link>
      <description>&lt;P&gt;You can find the end of the year with the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;year_end = intnx('year', today(), 0, 'e');

months = intck('month', date, year_end, 'D');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can nest those if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/315439"&gt;@PatrykSAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I'd like to see a number of months left from the date to the end of the year.&lt;/P&gt;
&lt;P&gt;I know to count month I can use intck('month', 'start', 'end', 'D') but how to get the "end" date when it's not given. I dont know how to pass the 'end' argument. Only what I got is the start date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to see:&lt;/P&gt;
&lt;P&gt;date&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;months&lt;/P&gt;
&lt;P&gt;01JUN2019&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;
&lt;P&gt;01APR2020&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a good day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 16:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631943#M18956</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-13T16:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count months from date to the end of the year</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631944#M18957</link>
      <description>&lt;P&gt;Use intnx() to get year's end (actually the start of next year since you want the current month to be counted also):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input date :date9.;
months_left = intck('month',date,intnx('year',date,0,'e') + 1);
format date yymmddd10.;
datalines;
01JUN2019
01APR2020
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Mar 2020 16:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Count-months-from-date-to-the-end-of-the-year/m-p/631944#M18957</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-13T16:02:32Z</dc:date>
    </item>
  </channel>
</rss>

