<?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: I want exact age with display like (23 Years,2 weeks,2 day) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371030#M88625</link>
    <description>&lt;P&gt;I tested the following on a number of dates and it appears to meet all posibilities:&lt;/P&gt;
&lt;PRE&gt;data sample;&lt;BR /&gt;  format date date9.;
  input date date9.;
  years=intck('year',date,today(),'C');
  months=intck('month',date,today(),'C')-(years*12);
  if day(date) le day(today()) then days=day(today())-day(date);
  else days=intck('day',mdy(month(intnx('month',today(),-1,'same')),
                   day(date),
                   year(intnx('month',today(),-1,'same'))),
             today(),'C');
  datediff=catx(' ',years,'years,',months,'months, and',days,'days');
  cards;
17may1991
29jun2016  
28jun2016
27jun2016
26jun2016  
25jun2016  
29may2016  
28may2016
27may2016
26may2016  
25may2016  
;  
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2017 18:58:56 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-06-27T18:58:56Z</dc:date>
    <item>
      <title>I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371012#M88622</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;can you please help on &amp;nbsp;the queary ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;datediff=yrdiff('17may1991'd),today(),"ACT/ACT");&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need answer Like this::-&lt;STRONG&gt;"26 years 1 months 10 days"&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 17:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371012#M88622</guid>
      <dc:creator>ganeshsas764</dc:creator>
      <dc:date>2017-06-27T17:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371013#M88623</link>
      <description>&lt;P&gt;You want to use the INTCK and INTNX functions, Read the article and modify the technique in the article &lt;A href="http://blogs.sas.com/content/iml/2017/05/15/intck-intnx-intervals-sas.html" target="_self"&gt;'INTCK and INTNX: Two essential functions for computing intervals between dates in SAS,"&lt;/A&gt;&amp;nbsp;which gives ages in the form Y YEARS and D DAYS. The article links to the documentation for those functions and a few SAS Global Forum papers that are worth reading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 17:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371013#M88623</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-27T17:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371030#M88625</link>
      <description>&lt;P&gt;I tested the following on a number of dates and it appears to meet all posibilities:&lt;/P&gt;
&lt;PRE&gt;data sample;&lt;BR /&gt;  format date date9.;
  input date date9.;
  years=intck('year',date,today(),'C');
  months=intck('month',date,today(),'C')-(years*12);
  if day(date) le day(today()) then days=day(today())-day(date);
  else days=intck('day',mdy(month(intnx('month',today(),-1,'same')),
                   day(date),
                   year(intnx('month',today(),-1,'same'))),
             today(),'C');
  datediff=catx(' ',years,'years,',months,'months, and',days,'days');
  cards;
17may1991
29jun2016  
28jun2016
27jun2016
26jun2016  
25jun2016  
29may2016  
28may2016
27may2016
26may2016  
25may2016  
;  
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 18:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371030#M88625</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-27T18:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371036#M88628</link>
      <description>&lt;P&gt;Nice. Looks pretty good, Art!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to be clear, we are all assuming that the DATE represents some event in the past, which seems to be the case for this question.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 19:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371036#M88628</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-06-27T19:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371143#M88661</link>
      <description>&lt;P&gt;Nice work, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 05:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/371143#M88661</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-28T05:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: I want exact age with display like (23 Years,2 weeks,2 day)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/372513#M89073</link>
      <description>&lt;P&gt;super , &amp;nbsp;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 08:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-exact-age-with-display-like-23-Years-2-weeks-2-day/m-p/372513#M89073</guid>
      <dc:creator>ganeshsas764</dc:creator>
      <dc:date>2017-07-02T08:09:19Z</dc:date>
    </item>
  </channel>
</rss>

