<?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: how to calculate months,years and weeks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438289#M109257</link>
    <description>&lt;P&gt;data have (drop=i); &lt;BR /&gt; format abc date9.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;do i = 1 to 11;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; abc = '19feb2014'd + i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;monthdif = intck('month',abc, date());&lt;BR /&gt;&amp;nbsp; &amp;nbsp;weekdif = intck('week',abc, date());&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yeardif = intck('year',abc, date());&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Feb 2018 18:37:25 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2018-02-18T18:37:25Z</dc:date>
    <item>
      <title>how to calculate months,years and weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438284#M109253</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to base sas programming.&lt;/P&gt;&lt;P&gt;i am&amp;nbsp; calculating&amp;nbsp; months,years and weeks in a sas data set that have a column of some dates, say "ABC"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="column ABC in data set" style="width: 96px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18670i00797BF785A541C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Untitled.png" alt="column ABC in data set" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;column ABC in data set&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and i have calculate&amp;nbsp; "months,years and weeks" from current date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pls suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 18:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438284#M109253</guid>
      <dc:creator>sumitbe139</dc:creator>
      <dc:date>2018-02-18T18:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate months,years and weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438286#M109254</link>
      <description>&lt;P&gt;Hi - Have a look at the INTNX function. It calculates different types of time intervals between two dates.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 18:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438286#M109254</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2018-02-18T18:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate months,years and weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438287#M109255</link>
      <description>Hi,&lt;BR /&gt;Thanks for your response&lt;BR /&gt;I have done it&lt;BR /&gt;&lt;BR /&gt;But I am stuck at how to assign a date1 to a column which as several dates in it pls see the image for reference.&lt;BR /&gt;&lt;BR /&gt;Y=intck("month",date1,date2)&lt;BR /&gt;Date2 is today date&lt;BR /&gt;&lt;BR /&gt;Pls suggest</description>
      <pubDate>Sun, 18 Feb 2018 18:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438287#M109255</guid>
      <dc:creator>sumitbe139</dc:creator>
      <dc:date>2018-02-18T18:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate months,years and weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438288#M109256</link>
      <description>I will come up with a working code example in 3 minutes.</description>
      <pubDate>Sun, 18 Feb 2018 18:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438288#M109256</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2018-02-18T18:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate months,years and weeks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438289#M109257</link>
      <description>&lt;P&gt;data have (drop=i); &lt;BR /&gt; format abc date9.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;do i = 1 to 11;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; abc = '19feb2014'd + i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want; set have;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;monthdif = intck('month',abc, date());&lt;BR /&gt;&amp;nbsp; &amp;nbsp;weekdif = intck('week',abc, date());&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yeardif = intck('year',abc, date());&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 18:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-months-years-and-weeks/m-p/438289#M109257</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2018-02-18T18:37:25Z</dc:date>
    </item>
  </channel>
</rss>

