<?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: Age in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932661#M366895</link>
    <description>&lt;P&gt;Are you sure that your PT.BIRTH_DATE is a date time value? If the a variable is actually a date value then the DATEPART function is likely returning a date in 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   x= datepart('29JUN2006'd);
   put x= date9.;
run;&lt;/PRE&gt;
&lt;P&gt;So likely every birth date in your data is generating ages &amp;gt; 17, mostly &amp;gt;60.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the values are dates remove the DATEPART function call.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 15:02:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-06-17T15:02:53Z</dc:date>
    <item>
      <title>Age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932649#M366891</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using this code for pulling the birthdate &amp;gt;17years&lt;/P&gt;&lt;P&gt;FLOOR(intck('MONTH',datepart(pt.BIRTH_DATE), date())/12)&amp;gt; 17&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the person who has DOB of 06/29/2006 is considered as 18years and pulling that person. i tried not to use FLOOR and it still gives me the same 18years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I fix this.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932649#M366891</guid>
      <dc:creator>Smitha9</dc:creator>
      <dc:date>2024-06-17T14:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932656#M366893</link>
      <description>&lt;P&gt;It's probably easier to use the &lt;A href="https://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1pmmr2dtec32an1vbsqmm3abil5.htm" target="_self"&gt;YRDIF&lt;/A&gt; function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;yrdif(datepart(pt.BIRTH_DATE),date(),'AGE')&amp;gt;=18&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;- I think that should give the answer you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932656#M366893</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2024-06-17T14:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932661#M366895</link>
      <description>&lt;P&gt;Are you sure that your PT.BIRTH_DATE is a date time value? If the a variable is actually a date value then the DATEPART function is likely returning a date in 1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   x= datepart('29JUN2006'd);
   put x= date9.;
run;&lt;/PRE&gt;
&lt;P&gt;So likely every birth date in your data is generating ages &amp;gt; 17, mostly &amp;gt;60.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the values are dates remove the DATEPART function call.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 15:02:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932661#M366895</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-06-17T15:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932730#M366915</link>
      <description>&lt;P&gt;You want to add the CONTINUOUS option to the INTCK() function count. Otherwise it is counting when you cross the BEGINNING of the month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  birth_date = '29JUN2006'd;
  birth_dt   = '29JUN2006:00:00'dt;
  format birth_date date9. birth_dt datetime18.;
  age = yrdif(BIRTH_DATE,date(),'AGE') ;
  yr1 = floor(intck('month',birth_date,date(),'c')/12);
  yr2 = floor(intck('month',datepart(birth_dt),date(),'c')/12);
  yr3 = floor(intck('month',datepart(birth_date),date(),'c')/12);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1718653818155.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97537i967EEC4DADADE2EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1718653818155.png" alt="Tom_0-1718653818155.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 19:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Age/m-p/932730#M366915</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-17T19:50:33Z</dc:date>
    </item>
  </channel>
</rss>

