<?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: Date difference in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68950#M19762</link>
    <description>Your code would be a lot simpler if you input the dates as dates rather than numbers.  E.g.:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data want;&lt;BR /&gt;
  informat EFdt yymmdd8.;&lt;BR /&gt;
  informat PEDt yymmn6.;&lt;BR /&gt;
  input EFdt PEDt;&lt;BR /&gt;
  age=intck('month',EFdt,PEDt);&lt;BR /&gt;
  cards;&lt;BR /&gt;
20100101 201006&lt;BR /&gt;
20000612 200009&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Art&lt;BR /&gt;
-------&lt;BR /&gt;
&amp;gt; I got it ..&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Below are my original dates :&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; EFdt                     PEDt&lt;BR /&gt;
&amp;gt; 20100101          201006&lt;BR /&gt;
&amp;gt; 20000612          200009&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I used this equation to get the difference..&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; AGE =&lt;BR /&gt;
&amp;gt; intck('month',MDY(mod(int(EFDT/100),100),mod(EFDT,100)&lt;BR /&gt;
&amp;gt; ,int(EFDT/10000)),&lt;BR /&gt;
&amp;gt; 							MDY(mod(PEDT,100),1,int(PEDT/100)));</description>
    <pubDate>Tue, 24 May 2011 15:37:21 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-05-24T15:37:21Z</dc:date>
    <item>
      <title>Date difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68948#M19760</link>
      <description>I am having two dates in the SAS dataset.&lt;BR /&gt;
x                         y&lt;BR /&gt;
200801           200903  &lt;BR /&gt;
200102           200111&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I need to find the number of months these dates apart.&lt;BR /&gt;
&lt;BR /&gt;
I have used intck but answer looks different.&lt;BR /&gt;
&lt;BR /&gt;
Can some one help?</description>
      <pubDate>Tue, 24 May 2011 15:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68948#M19760</guid>
      <dc:creator>SAS83</dc:creator>
      <dc:date>2011-05-24T15:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68949#M19761</link>
      <description>I got it ..&lt;BR /&gt;
&lt;BR /&gt;
Below are my original dates :&lt;BR /&gt;
&lt;BR /&gt;
EFdt                     PEDt&lt;BR /&gt;
20100101          201006&lt;BR /&gt;
20000612          200009&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I used this equation to get the difference..&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
AGE = intck('month',MDY(mod(int(EFDT/100),100),mod(EFDT,100),int(EFDT/10000)),&lt;BR /&gt;
							MDY(mod(PEDT,100),1,int(PEDT/100)));</description>
      <pubDate>Tue, 24 May 2011 15:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68949#M19761</guid>
      <dc:creator>SAS83</dc:creator>
      <dc:date>2011-05-24T15:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68950#M19762</link>
      <description>Your code would be a lot simpler if you input the dates as dates rather than numbers.  E.g.:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data want;&lt;BR /&gt;
  informat EFdt yymmdd8.;&lt;BR /&gt;
  informat PEDt yymmn6.;&lt;BR /&gt;
  input EFdt PEDt;&lt;BR /&gt;
  age=intck('month',EFdt,PEDt);&lt;BR /&gt;
  cards;&lt;BR /&gt;
20100101 201006&lt;BR /&gt;
20000612 200009&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Art&lt;BR /&gt;
-------&lt;BR /&gt;
&amp;gt; I got it ..&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Below are my original dates :&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; EFdt                     PEDt&lt;BR /&gt;
&amp;gt; 20100101          201006&lt;BR /&gt;
&amp;gt; 20000612          200009&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I used this equation to get the difference..&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; AGE =&lt;BR /&gt;
&amp;gt; intck('month',MDY(mod(int(EFDT/100),100),mod(EFDT,100)&lt;BR /&gt;
&amp;gt; ,int(EFDT/10000)),&lt;BR /&gt;
&amp;gt; 							MDY(mod(PEDT,100),1,int(PEDT/100)));</description>
      <pubDate>Tue, 24 May 2011 15:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68950#M19762</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-05-24T15:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Date difference</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68951#M19763</link>
      <description>Thanks Art..</description>
      <pubDate>Tue, 24 May 2011 18:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Date-difference/m-p/68951#M19763</guid>
      <dc:creator>SAS83</dc:creator>
      <dc:date>2011-05-24T18:37:21Z</dc:date>
    </item>
  </channel>
</rss>

