<?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: Determine age when DOB is prior to 1960 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974141#M377814</link>
    <description>&lt;P&gt;Check if your log says "Note: missing values were calculated at... "&amp;nbsp; That would suggest that either DOB or Date_01 are missing values for some records.&amp;nbsp; Many people treat that missing values note as an error message.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Sep 2025 18:33:20 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2025-09-04T18:33:20Z</dc:date>
    <item>
      <title>Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974135#M377810</link>
      <description>&lt;P&gt;Hello there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to determine age over many, many records. I'm using the function: int(yrdif(dob, date_01, 'AGE')).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both DOB and Date_01 are formatted MMDDYY10. However, I get no results for some records. The only pattern I can see is that the no result records are for people born prior to January 1, 1960. I'm assuming this is because prior to that the result is negative but that's only an assumption. I've tried the option yearcutoff=1910 but that doesn't seem to help. Can anyone tell me if there's a better way to determine age in the situation where some records are pre and some are post?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 17:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974135#M377810</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-04T17:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974137#M377812</link>
      <description>&lt;P&gt;I don't see a problem in this very small test:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
    input (dob date_01) (yymmdd10.);
    age=int(yrdif(dob,date_01,'AGE'));
datalines;
1955-01-01 2025-08-15
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Format of the variables is irrelevant. Negative dates are irrelevant. If the dates are truly dates, then YEARCUTOFF= should be irrelevant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide the full data step or full SQL code, not a fraction of a line of code as in your original message. Also, if there are WARNINGS or ERRORs in the log, please show us the log for this data step or SQL (and not just the lines with the WARNINGs or ERRORs, we need to see the full log for this data step or SQL.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide a small sample of data that includes dates before and after 01JAN1960. Best would be if the dates are UNformatted (yes UNFORMATTED). Please provide the data as DATA step code, according to these &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;&amp;nbsp;as I have done above;&amp;nbsp; or I think this short program will work as well in this situation on a small subset of the data with dates before and after 01JAN1960. &lt;EM&gt;&lt;FONT color="#FF0000"&gt;Do not provide the data via COPY/PASTE from Excel, do not provide the data as an Excel file.&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=abc; /* Use your real data set name here */
    var dob date_01 age;
    format dob date_01; /* Unformatted */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 18:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974137#M377812</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-04T18:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974140#M377813</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm not sure what your date_01 variable is. However, testing on age based on today's date, I get these results:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1757007966676.jpeg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109618iC51DF6B4D4C9D320/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1757007966676.jpeg" alt="Cynthia_sas_0-1757007966676.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see/subtract yourself, the ages are all correct given the dates both before and after Jan 1 1960.&lt;/P&gt;&lt;P&gt;I used this code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1757008126888.jpeg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109619i6D3987D171B6A791/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1757008126888.jpeg" alt="Cynthia_sas_1-1757008126888.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect that yearcutoff is not your issue because with a 4 digit year, you should not have any issues. And your use of mmddyy10 for the format&amp;nbsp; implies that you have a 4 digit year.&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 17:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974140#M377813</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-09-04T17:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974141#M377814</link>
      <description>&lt;P&gt;Check if your log says "Note: missing values were calculated at... "&amp;nbsp; That would suggest that either DOB or Date_01 are missing values for some records.&amp;nbsp; Many people treat that missing values note as an error message.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 18:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974141#M377814</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-09-04T18:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974142#M377815</link>
      <description>&lt;P&gt;Thanks to all who are contributing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see by the attached data example why I'm thinking this is a 1/1/1960 issue. I know the log states a divide by zero option but both dates do exist for those records without an age showing even in the log warning. I believe the warning most likely coming from a unrelated function in the same data step since the step has other included work. The missing data begins prior to 1/1/1960 (date zero) and picks up the first date after 1/1/1960 even though the two dates clearly exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;dob=12/31/1959 
date_01=1/11/2024
age_on_date=.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data temp;
	Set temp_01;
    age_on_date = int(yrdif(dob,  date_01,  'AGE'));
run;

NOTE: Division by zero detected at line 229 column 32.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;TABLE width="238"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="73"&gt;dob&lt;/TD&gt;
&lt;TD width="73"&gt;date_01&lt;/TD&gt;
&lt;TD width="92"&gt;age_on_date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;12/31/1959&lt;/TD&gt;
&lt;TD&gt;1/11/2024&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;12/31/1959&lt;/TD&gt;
&lt;TD&gt;1/11/2024&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1/1/1960&lt;/TD&gt;
&lt;TD&gt;4/28/1987&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1/1/1960&lt;/TD&gt;
&lt;TD&gt;4/28/1987&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1/1/1960&lt;/TD&gt;
&lt;TD&gt;4/28/1987&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1/1/1960&lt;/TD&gt;
&lt;TD&gt;4/28/1987&lt;/TD&gt;
&lt;TD&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1/1/1960&lt;/TD&gt;
&lt;TD&gt;4/28/1987&lt;/TD&gt;
&lt;TD&gt;.&lt;/T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;
&lt;TR&gt;
&lt;TD&gt;1/10/1960&lt;/TD&gt;
&lt;TD&gt;12/18/2012&lt;/TD&gt;
&lt;TD&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974142#M377815</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-04T19:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974143#M377816</link>
      <description>&lt;P&gt;Can we see the unformatted values, as I suggested, by using the PROC PRINT code I provided?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Problems like this with dates not doing what is expected are sometimes difficult to debug. This is why I am asking for specific information, we need you to provide the specific information I asked for, and not the information you decide is good enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I cannot imagine where Division by 0 comes in here unless there's more to the code that you are not showing us. Can you show us the &lt;STRONG&gt;ENTIRE&lt;/STRONG&gt; log for this data set (not just the warnings or errors) as I requested?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not get missings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
    input (dob date_01) (yymmdd10.);
    age=int(yrdif(dob,date_01,'AGE'));
    format dob date_01 mmddyy10.;
datalines;
1959-12-31 2024-01-11
;

proc print data=abc;
    var dob date_01 age;
    format dob date_01;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974143#M377816</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-04T19:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974144#M377817</link>
      <description>&lt;P&gt;Something else is the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those dates work fine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
  input dob :mmddyy. date_01 :mmddyy. wrong ;
  right = int(yrdif(dob,  date_01,  'AGE'));
  format dob date_01 yymmdd10.;
cards;
1/1/1960   4/28/1987   .
1/1/1960   9/28/2021   .
1/10/1960  12/18/2012 52
1/9/1960   6/5/2007   47
12/31/1959 1/11/2024   .
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs           dob       date_01    wrong    right

 1     1960-01-01    1987-04-28       .       27
 2     1960-01-01    2021-09-28       .       61
 3     1960-01-10    2012-12-18      52       52
 4     1960-01-09    2007-06-05      47       47
 5     1959-12-31    2024-01-11       .       64
&lt;/PRE&gt;
&lt;P&gt;Most likely the values in the listing you posted are CHARACTER strings that you tried to CONVERT into dates.&amp;nbsp; Check that step for the source of the errors. Most likely it either read the strings using the wrong informat (or wrongly placed so that it read only some of the string or parts of the strings next to the date).&amp;nbsp; Or perhaps there were tabs or other invisible characters in the strings that cause the conversion to fail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if they were DATE values printed with the MMDDYY10. format they would look like this instead:&lt;/P&gt;
&lt;PRE&gt;Obs           dob       date_01    wrong    right

 1     01/01/1960    04/28/1987       .       27
 2     01/01/1960    09/28/2021       .       61
 3     01/10/1960    12/18/2012      52       52
 4     01/09/1960    06/05/2007      47       47
 5     12/31/1959    01/11/2024       .       64
&lt;/PRE&gt;
&lt;P&gt;Notice how this listing is showing the &lt;STRONG&gt;leading zeros&lt;/STRONG&gt; in single digit days and months that was missing in the text strings you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974144#M377817</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-09-04T19:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974145#M377818</link>
      <description>&lt;P&gt;Certainly.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="3" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl66" style="height: 15.0pt; width: 48pt;"&gt;dob&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-left: none; width: 48pt;"&gt;date_01&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-left: none; width: 48pt;"&gt;age_on_date&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;-1&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;23386&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;-1&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;23386&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;0&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;22551&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;8&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;17322&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl66" style="height: 15.0pt; border-top: none;"&gt;9&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;19345&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;52&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974145#M377818</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-04T19:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974149#M377820</link>
      <description>&lt;P&gt;Those values also work.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input dob date_01 wrong ;
cards;
-1 23386 .
-1 23386 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
0 22551 .
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
8 17322 47
9 19345 52
9 19345 52
9 19345 52
9 19345 52
9 19345 52
9 19345 52
;
proc sort nodupkey;
  by _all_;
run;

data want;
  set have;
  format dob date_01 mmddyy10.;
  right = int(yrdif(dob,  date_01,  'AGE'));
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs           dob       date_01    wrong    right

 1     12/31/1959    01/11/2024       .       64
 2     01/01/1960    09/28/2021       .       61
 3     01/09/1960    06/05/2007      47       47
 4     01/10/1960    12/18/2012      52       52
&lt;/PRE&gt;
&lt;P&gt;Check all of the steps in your log.&amp;nbsp; Make sure they completed and updated the output dataset. Make sure you are actually looking at the updated dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974149#M377820</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-09-04T19:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974150#M377821</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3264"&gt;@Jeff_DOC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I requested the unformatted data. Thank you. I also requested the &lt;STRONG&gt;ENTIRE&lt;/STRONG&gt; log for this data step (not just the errors or warnings, but every line in the log for this data step), which I still need.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 19:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974150#M377821</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-04T19:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974153#M377822</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;. There's something else happening with your data or your code. Just using some of your data values, I still get the correct values calculated -- even with a date in 1884 thrown in just for additional proof:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1757015912326.jpeg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109621i46F47E4AF28D89FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1757015912326.jpeg" alt="Cynthia_sas_0-1757015912326.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I wonder what is in your original data that is causing the problem. As demonstrated with multiple examples, the code should generate a correct results, assuming that the date values used by your functions are actual SAS date values.&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 20:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974153#M377822</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2025-09-04T20:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974154#M377823</link>
      <description>&lt;P&gt;Can you replicate the problem with the little step you showed?&amp;nbsp; &amp;nbsp;Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set temp_01 ;
  age_on_date = int(yrdif(dob,  date_01,  'AGE')) ;

  if missing(age_on_date) then put dob= date_01= ;
  format dob date_01 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If so, then please post the full log from running that step.&amp;nbsp; Well maybe, not the full log if it's 1000s of lines from the PUT statement....&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 20:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974154#M377823</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2025-09-04T20:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974278#M377865</link>
      <description>&lt;P&gt;Thank you to everyone who took the time to reply to me. I accepted Cynthia's solution because that was the response I was reading when what Paige and Cynthia were saying finally got through to me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I so wish I could split solutions into percentages.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 17:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974278#M377865</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-05T17:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974286#M377867</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3264"&gt;@Jeff_DOC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you to everyone who took the time to reply to me. I accepted Cynthia's solution because that was the response I was reading when what Paige and Cynthia were saying finally got through to me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I so wish I could split solutions into percentages.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3264"&gt;@Jeff_DOC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is frustrating. We have tried to help you, but we want you to help us as well. Please clearly state the solution. It's clear that Cynthia and I did not present a solution; we both tried to debug this situation, neither of us offered a solution.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 18:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974286#M377867</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-05T18:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974287#M377868</link>
      <description>&lt;P&gt;I don't believe that's accurate. The key information in your responses was "there's something else going on here" since neither of you could replicate my issue given my (or your own data). Therefore, what/where I thought the issue was, was not and I was forced to "back up a step" and consider the input information not just the result.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 18:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974287#M377868</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-05T18:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974288#M377869</link>
      <description>&lt;P&gt;A change to your thought processes is not a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please be kind enough to help us understand and clearly state the solution to your programming issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 19:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974288#M377869</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-09-05T19:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974290#M377871</link>
      <description>&lt;P&gt;I still bet it was improper reading of text file.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have; 
  input 
     @1 dob :mmddyy. date :mmddyy.
     @1 bad_dob mmddyy10. bad_date mmddyy10. 
  ;
  format _all_ date9.;
cards;
1/1/1960 4/28/1987   
1/1/1960 9/28/2021   
1/10/1960 12/18/2012 
1/9/1960 6/5/2007    
12/31/1959 1/11/2024 
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs          dob         date      bad_dob     bad_date

 1     01JAN1960    28APR1987    01JAN1960            .
 2     01JAN1960    28SEP2021    01JAN1960            .
 3     10JAN1960    18DEC2012    10JAN1960    18DEC2012
 4     09JAN1960    05JUN2007    09JAN1960            .
 5     31DEC1959    11JAN2024    31DEC1959    11JAN2024

&lt;/PRE&gt;
&lt;P&gt;Log&lt;/P&gt;
&lt;PRE&gt;1    data have;
2      input
3         @1 dob :mmddyy. date :mmddyy.
4         @1 bad_dob mmddyy10. bad_date mmddyy10.
5      ;
6      format _all_ date9.;
7    cards;

NOTE: Invalid data for bad_date in line 8 11-20.
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----
8          1/1/1960 4/28/1987
dob=01JAN1960 date=28APR1987 bad_dob=01JAN1960 bad_date=. _ERROR_=1 _N_=1
NOTE: Invalid data for bad_date in line 9 11-20.
9          1/1/1960 9/28/2021
dob=01JAN1960 date=28SEP2021 bad_dob=01JAN1960 bad_date=. _ERROR_=1 _N_=2
NOTE: Invalid data for bad_date in line 11 11-20.
11         1/9/1960 6/5/2007
dob=09JAN1960 date=05JUN2007 bad_dob=09JAN1960 bad_date=. _ERROR_=1 _N_=4
NOTE: The data set WORK.HAVE has 5 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Sep 2025 19:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974290#M377871</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-09-05T19:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Determine age when DOB is prior to 1960</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974292#M377873</link>
      <description>&lt;P&gt;Sorry, I'm not good enough to clearly state the problem and/or solution. That data step performed other functions and when I moved the age determination outside of the problematic data step it worked just fine and that's the most important thing. The data step performed other functions so I'm assuming one conflicted or one of the variables in my function was dependent on that and I was attempting to this age calculation. Moving it outside of the data step eliminated that conflict and it runs just fine. The key concept from Cynthia and Paige was that perhaps my function wasn't to blame (since I did not change it, I just moved it). So it wasn't the particular function at fault, which is what I had focused on. A good reminder to me to check other possibilities.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 19:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Determine-age-when-DOB-is-prior-to-1960/m-p/974292#M377873</guid>
      <dc:creator>Jeff_DOC</dc:creator>
      <dc:date>2025-09-05T19:31:28Z</dc:date>
    </item>
  </channel>
</rss>

