<?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 difference between 2 dates in MONTHS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596815#M16027</link>
    <description>&lt;P&gt;dear SAS experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to programm the following difference between 2 dates and test if the difference in months is inferior to 6 months.&lt;/P&gt;&lt;P&gt;I can do this in days, but I can't get the right way to do this in Months (I cannot use standardized months or so, unfortunately)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (DATE1 - DATE2) &amp;lt; 6&amp;nbsp;&amp;nbsp; then NewParameter = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I correct the (DATE1 - DATE2) expression to get the result in months?&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 11:08:33 GMT</pubDate>
    <dc:creator>PierreYvesILY</dc:creator>
    <dc:date>2019-10-16T11:08:33Z</dc:date>
    <item>
      <title>difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596815#M16027</link>
      <description>&lt;P&gt;dear SAS experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to programm the following difference between 2 dates and test if the difference in months is inferior to 6 months.&lt;/P&gt;&lt;P&gt;I can do this in days, but I can't get the right way to do this in Months (I cannot use standardized months or so, unfortunately)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (DATE1 - DATE2) &amp;lt; 6&amp;nbsp;&amp;nbsp; then NewParameter = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I correct the (DATE1 - DATE2) expression to get the result in months?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596815#M16027</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2019-10-16T11:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596818#M16028</link>
      <description>&lt;P&gt;The &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p1md4mx2crzfaqn14va8kt7qvfhr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;INTCK Function&lt;/A&gt; returns the number of interval boundaries between two dates&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    dt1='01jan2019'd;
    dt2='16oct2019'd;

    difmonths=intck('month', dt1, dt2);

    put difmonths=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596818#M16028</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-16T11:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596819#M16029</link>
      <description>&lt;P&gt;Please try the intck function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if intck('month', start_date, end_date, 'continuous')&amp;lt;6 then newparameter=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596819#M16029</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-10-16T11:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596822#M16030</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281554"&gt;@PierreYvesILY&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest to use the intck() function.&lt;/P&gt;
&lt;DIV class="page" title="Page 284"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;P&gt;&lt;SPAN&gt;It returns the number of interval boundaries of a given kind, like months.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this help!&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	month_dif = intck('month',date1,date2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596822#M16030</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-10-16T11:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596827#M16032</link>
      <description>Danke dir!</description>
      <pubDate>Wed, 16 Oct 2019 11:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596827#M16032</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2019-10-16T11:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596835#M16033</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281554"&gt;@PierreYvesILY&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;posted is the solution for you then please mark it as solution so we know you've got your answer. Marking something as solution will also help others who search the forums later on to get answers to similar problems.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596835#M16033</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-16T11:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596839#M16034</link>
      <description>&lt;P&gt;I always test the solutions proposed before sending an approval.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just got my tests results and can now close the question.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596839#M16034</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2019-10-16T11:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: difference between 2 dates in MONTHS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596860#M16036</link>
      <description>&lt;P&gt;I implemented this solution, which has been tested now on a range of 200000 cases without any pb.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 13:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/difference-between-2-dates-in-MONTHS/m-p/596860#M16036</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2019-10-16T13:04:04Z</dc:date>
    </item>
  </channel>
</rss>

