<?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: Converting age from days to years in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865854#M341940</link>
    <description>&lt;P&gt;If this is part of an explicit pass-through (we can't tell, as you did not post the complete code), you must use Teradata syntax.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 06:37:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-23T06:37:04Z</dc:date>
    <item>
      <title>Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/841804#M332848</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;The age variable in my dataset is reported in days, how do I can convert that to age in years?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 04:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/841804#M332848</guid>
      <dc:creator>Rou</dc:creator>
      <dc:date>2022-11-01T04:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/841808#M332849</link>
      <description>&lt;P&gt;The best way to calculate the age is by using the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1pmmr2dtec32an1vbsqmm3abil5.htm" target="_blank" rel="noopener"&gt;YRDIF Function&lt;/A&gt;&amp;nbsp;with the date of birth and &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0hm9egy8s7mokn1mz0yxng80ax5.htm" target="_blank" rel="noopener"&gt;TODAY()&lt;/A&gt; as arguments.&lt;/P&gt;
&lt;P&gt;From a number of days, use &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p1xuvvu3to43jmn187gqlmpk3hi7.htm" target="_blank" rel="noopener"&gt;FLOOR&lt;/A&gt;(days / 365.25).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;&lt;EM&gt;Edit: added links to the function documentation.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 07:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/841808#M332849</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-01T07:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/842009#M332929</link>
      <description>Thank you!</description>
      <pubDate>Wed, 02 Nov 2022 00:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/842009#M332929</guid>
      <dc:creator>Rou</dc:creator>
      <dc:date>2022-11-02T00:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865813#M341919</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;How do I calculate age while using a connection to teradata date of birth field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I tried so far:&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;select&lt;BR /&gt;DMA.MCID&lt;BR /&gt;,frfm.HCC_CD&lt;BR /&gt;,DMA.GNDR_NM&lt;BR /&gt;,floor ((intck('month',DMA.MBR_BRTH_DT,today()) - (day(today()) &amp;lt; day(DMA.MBR_BRTH_DT))) / 12) as age&lt;BR /&gt;,INCRD_YEAR_MNTH_NBR&lt;BR /&gt;,case when max(PRORTD_MBR_MNTH_CNT) &amp;gt;0 then 1 else 0 END AS PRORTD_MBR_MNTH_CNT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Teradata prepare: Syntax error: expected something between '(' and the string 'month'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 22:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865813#M341919</guid>
      <dc:creator>Hdababs</dc:creator>
      <dc:date>2023-03-22T22:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865854#M341940</link>
      <description>&lt;P&gt;If this is part of an explicit pass-through (we can't tell, as you did not post the complete code), you must use Teradata syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 06:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865854#M341940</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-23T06:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865921#M341971</link>
      <description>&lt;P&gt;Thank you. I used teradata syntax.&lt;/P&gt;&lt;P&gt;Here is what I used:&lt;/P&gt;&lt;P&gt;('2022' - extract(year from teradata birth date column name)) as Age&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 13:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865921#M341971</guid>
      <dc:creator>Hdababs</dc:creator>
      <dc:date>2023-03-23T13:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting age from days to years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865922#M341972</link>
      <description>&lt;P&gt;See my answer to your other post concerning the same issue.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 13:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-age-from-days-to-years/m-p/865922#M341972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-23T13:10:32Z</dc:date>
    </item>
  </channel>
</rss>

