<?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 Age from BirthDate! in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80935#M23330</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a date(DOB) and I want to know the years?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;DOB&lt;/P&gt;&lt;P&gt;12sep1982&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want something like(probably not in decimals)&lt;/P&gt;&lt;P&gt;AGE:&lt;/P&gt;&lt;P&gt;31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 23:50:54 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2013-09-12T23:50:54Z</dc:date>
    <item>
      <title>Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80935#M23330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a date(DOB) and I want to know the years?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;DOB&lt;/P&gt;&lt;P&gt;12sep1982&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want something like(probably not in decimals)&lt;/P&gt;&lt;P&gt;AGE:&lt;/P&gt;&lt;P&gt;31&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 23:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80935#M23330</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-09-12T23:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80936#M23331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;format dob date9.;&lt;/P&gt;&lt;P&gt;input dob date9.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;02sep1982&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt; set have;&lt;/P&gt;&lt;P&gt; age=int((today()-dob)/365.25);&lt;/P&gt;&lt;P&gt; proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 00:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80936#M23331</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2013-09-13T00:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80937#M23332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The INTCK function measures the number of intervals between 2 dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA WANT;&lt;/P&gt;&lt;P&gt;SET HAVE;&lt;/P&gt;&lt;P&gt;AGE = INTCK('YEAR',DOB,TODAY());&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 00:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80937#M23332</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-13T00:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80938#M23333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;age=YRDIF(DoB, today(), 'ACT/ACT') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000530606.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000530606.htm"&gt;SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 01:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80938#M23333</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-09-13T01:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80939#M23334</link>
      <description>&lt;P&gt;You may like to read this -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href=" http://www.lexjansen.com/wuss/2009/cod/COD-Adams.pdf" target="_self"&gt;Age Is Just a Number: Accurately Calculating Integer and Continuous Age&lt;/A&gt; by Sara Adams and Chris Colby, ICON Clinical Research, San Francisco, CA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The paper discusses&amp;nbsp;&lt;STRONG&gt;integer age&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;continuous age&lt;/STRONG&gt; -- and methods to calculate each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;If have SAS 9.3 or higher use &lt;STRONG&gt;YRDIF&lt;/STRONG&gt;(dob,eventdt,'AGE'); [&lt;A href="http://blogs.sas.com/content/sasdummy/2011/07/12/computing-age-in-sas-9-3/" target="_self"&gt;article with examples here&lt;/A&gt;]&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS instructor&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5008"&gt;@D_Dunlap&lt;/a&gt;&amp;nbsp;covers this topic and many other &lt;A href="https://youtu.be/vKYCqK0ODVw" target="_self"&gt;Date function FAQs in this video&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;div class="video-embed-center video-embed"&gt;&lt;iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvKYCqK0ODVw%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvKYCqK0ODVw&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvKYCqK0ODVw%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" width="400" height="225" scrolling="no" title="SAS Tutorial | SAS Date Functions FAQs" frameborder="0" allow="autoplay; fullscreen; encrypted-media; picture-in-picture;" allowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2019 14:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80939#M23334</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2019-09-25T14:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80940#M23335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using INTCK() the following would return '1' which I believe is not what you would expect to get as age:&lt;/P&gt;&lt;P&gt;INTCK('YEAR','31DEC2012'd,'01JAN2013'd);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 01:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80940#M23335</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-09-13T01:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80941#M23336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agreed Patrick.&amp;nbsp; Once I read your suggestion regarding YRDIF I remembered that INTCK was the incorrect solution for this scenario.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 01:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80941#M23336</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2013-09-13T01:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80942#M23337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If have SAS 9.3 or higher use YRDIF(dob,eventdt,'AGE');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/36/977.html" title="http://support.sas.com/kb/36/977.html"&gt;36977 - Using the YRDIF function to calculate age can give incorrect results in SAS&amp;amp;reg; releases prior to 9.3&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2013 01:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/80942#M23337</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-09-13T01:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/235040#M54995</link>
      <description>&lt;P&gt;I am trying to calculte age as well using SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the code i have used but the age is off by one year. How to correct it?&lt;/P&gt;&lt;P&gt;*creating Mat_age*/;&lt;BR /&gt;MAT_AGE = (int(new_DOB - new_MomDOB)/365.25);&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/235040#M54995</guid>
      <dc:creator>new_sas2015</dc:creator>
      <dc:date>2015-11-17T15:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/235103#M55017</link>
      <description>&lt;P&gt;I think you intended to apply the INT function to the entire computed value, so you need to move a paren:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MAT_AGE = int( (new_DOB - new_MomDOB) /365.25);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But the better way (I think) is to use YRDIF with the AGE modifier:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MAT_AGE = yrdif(new_DOB, new_MomDOB,'AGE');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See: &lt;A href="http://blogs.sas.com/content/sasdummy/2011/07/12/computing-age-in-sas-9-3/" target="_self"&gt;http://blogs.sas.com/content/sasdummy/2011/07/12/computing-age-in-sas-9-3/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2015 18:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/235103#M55017</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2015-11-17T18:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/387869#M65885</link>
      <description>Hi,&lt;BR /&gt;When I use the INTCK function I get a message (window is full and must be cleared. Select:&lt;BR /&gt;F to file.&lt;BR /&gt;P to Print&lt;BR /&gt;S to save or&lt;BR /&gt;C to clear the window without saving&lt;BR /&gt;&lt;BR /&gt;Any insights why this is happening?</description>
      <pubDate>Mon, 14 Aug 2017 17:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/387869#M65885</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2017-08-14T17:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/387870#M65886</link>
      <description>Hi,&lt;BR /&gt;When I use the INTCK fuction I get a message (window is full and must be cleared. Select:&lt;BR /&gt;F to file.&lt;BR /&gt;P to Print&lt;BR /&gt;S to save or&lt;BR /&gt;C to clear the window without saving&lt;BR /&gt;&lt;BR /&gt;Any insights why this is happening?</description>
      <pubDate>Mon, 14 Aug 2017 17:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/387870#M65886</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2017-08-14T17:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Age from BirthDate!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/558417#M74816</link>
      <description>&lt;P&gt;I believe this happens because the alignment option in the INTCK function defaults to DISCRETE, which counts interval boundaries in between two dates, rather than CONTINUOUS, which counts full intervals in between dates, shifted to the start date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AGE = INTCK('YEAR',DOB,TODAY(),'C');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;See here for details:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm#n1gtwtxg68khzjn1rkmjlksobk51" target="_blank" rel="noopener"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1md4mx2crzfaqn14va8kt7qvfhr.htm#n1gtwtxg68khzjn1rkmjlksobk51&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 18:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Age-from-BirthDate/m-p/558417#M74816</guid>
      <dc:creator>NoClassAllSAS</dc:creator>
      <dc:date>2019-05-13T18:51:52Z</dc:date>
    </item>
  </channel>
</rss>

