<?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: find age from a numeric and and date values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/find-age-from-a-numeric-and-and-date-values/m-p/810757#M33875</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
ageattest = year(hbv2) - CDOB;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2022 22:07:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-04-29T22:07:19Z</dc:date>
    <item>
      <title>find age from a numeric and and date values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-age-from-a-numeric-and-and-date-values/m-p/810756#M33874</link>
      <description>&lt;P&gt;ok so, I have been working on this for a while, and I just need this last step figured out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want age at the hbv test (hbv2) and I have the date of birth (CDOB).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do this code and get this output but obviously that isn't correct so what can I do to fix this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;ageattest = hbv2 - CDOB;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cooksam13_0-1651269577005.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71000iCE13C1FA8C2FF235/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cooksam13_0-1651269577005.png" alt="Cooksam13_0-1651269577005.png" /&gt;&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;this is proc contents for the two variables&lt;/P&gt;&lt;P&gt;Variable Type Len Format Informat Label&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;hbv2&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;YEAR.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CDOB&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;8.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 29 Apr 2022 22:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-age-from-a-numeric-and-and-date-values/m-p/810756#M33874</guid>
      <dc:creator>Cooksam13</dc:creator>
      <dc:date>2022-04-29T22:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: find age from a numeric and and date values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/find-age-from-a-numeric-and-and-date-values/m-p/810757#M33875</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
ageattest = year(hbv2) - CDOB;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's a great, but longer and in depth, reference for dates and times in SAS&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 22:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/find-age-from-a-numeric-and-and-date-values/m-p/810757#M33875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-04-29T22:07:19Z</dc:date>
    </item>
  </channel>
</rss>

