<?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 Calculate a missing year of birth, when month of birth, day of birth and age are available in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693517#M211477</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying&amp;nbsp; to derive a year of birth (YOB) when month of birth (MOB), day of birth (DOB), age and a reference date (TODAY) are all available. For example, with some fictitious data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YOB -&amp;nbsp;&lt;/P&gt;&lt;P&gt;MOB -10&lt;/P&gt;&lt;P&gt;DOB - 26&lt;/P&gt;&lt;P&gt;AGE- 30&lt;/P&gt;&lt;P&gt;Date data was entered: TODAY = DATE();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 14:24:31 GMT</pubDate>
    <dc:creator>Steevo116</dc:creator>
    <dc:date>2020-10-22T14:24:31Z</dc:date>
    <item>
      <title>Calculate a missing year of birth, when month of birth, day of birth and age are available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693517#M211477</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying&amp;nbsp; to derive a year of birth (YOB) when month of birth (MOB), day of birth (DOB), age and a reference date (TODAY) are all available. For example, with some fictitious data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YOB -&amp;nbsp;&lt;/P&gt;&lt;P&gt;MOB -10&lt;/P&gt;&lt;P&gt;DOB - 26&lt;/P&gt;&lt;P&gt;AGE- 30&lt;/P&gt;&lt;P&gt;Date data was entered: TODAY = DATE();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693517#M211477</guid>
      <dc:creator>Steevo116</dc:creator>
      <dc:date>2020-10-22T14:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a missing year of birth, when month of birth, day of birth and age are available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693522#M211481</link>
      <description>&lt;P&gt;You tell us. If you had to do this pencil and paper rather than in SAS, what is the answer you want from this example? Show the calculation steps.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693522#M211481</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-22T14:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a missing year of birth, when month of birth, day of birth and age are available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693525#M211484</link>
      <description>Calculate age as if today was birthday and year of birth is Today's year - age (2020 - age). &lt;BR /&gt;Compare that value to the actual age to determine year of birth. &lt;BR /&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693525#M211484</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-22T14:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a missing year of birth, when month of birth, day of birth and age are available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693540#M211492</link>
      <description>&lt;P&gt;you can use the following code to do that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if mdy(mob,dob,year(today())) - today()&amp;lt;=0 then YOB=year(intnx("year",today(),-age)) ;
else YOB=year(intnx("year",today(),-age-1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 15:26:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693540#M211492</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-10-22T15:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate a missing year of birth, when month of birth, day of birth and age are available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693544#M211494</link>
      <description>&lt;P&gt;Thanks Reeza, I've made progress with your help. This is what I have so far, however I'm missing a statement and some formats to automatically add year (program will run on large dataset over more than one year).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There might be a better way to express today's date so I don't need to remove the year afterwards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;FONT color="navy"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;FONT color="black"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;want;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;set&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;have;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Birthday = cat(MOB,DOB);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new=input(Birthday,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="teal"&gt;&lt;STRONG&gt;4.0&lt;/STRONG&gt;&lt;/FONT&gt;);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;drop&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Birthday;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;rename&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;new=Birthday;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; today = DATE();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="green"&gt;/*Insert statement to convert today MMDD (simple numeric format like Birthday above)*/&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT face="Courier New" size="2" color="blue"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;today &amp;gt;= Birthday&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="blue"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="blue"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YOB=&lt;FONT color="green"&gt;/*Format to insert current year*/&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- age;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;end&lt;/FONT&gt;;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;if&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;today &amp;lt; Birthday&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;then&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;do&lt;/FONT&gt;;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YOB=&lt;FONT color="green"&gt;/*Format to insert current year*/&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- (age-&lt;FONT color="teal"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt;);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="blue"&gt;end&lt;/FONT&gt;;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="navy"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;FONT color="black"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Oct 2020 15:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-a-missing-year-of-birth-when-month-of-birth-day-of/m-p/693544#M211494</guid>
      <dc:creator>Steevo116</dc:creator>
      <dc:date>2020-10-22T15:35:33Z</dc:date>
    </item>
  </channel>
</rss>

