<?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: Calculating age in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981726#M379182</link>
    <description>&lt;P&gt;If you want the middle of the year, you can change the MDY function to the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;age=floor(YRDIF(d_birth, mdy(6,30,2025),"AGE"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 Jan 2026 18:17:54 GMT</pubDate>
    <dc:creator>Kathryn_SAS</dc:creator>
    <dc:date>2026-01-08T18:17:54Z</dc:date>
    <item>
      <title>Calculating age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981725#M379181</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering if it is possible to calculate the age in the middle of the year. At the end of the year I have :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;floor(YRDIF(d_birth, mdy(12,31,2025),"AGE"))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; How to calculate the age on 6/30 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 18:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981725#M379181</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2026-01-08T18:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981726#M379182</link>
      <description>&lt;P&gt;If you want the middle of the year, you can change the MDY function to the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;age=floor(YRDIF(d_birth, mdy(6,30,2025),"AGE"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jan 2026 18:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981726#M379182</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2026-01-08T18:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981747#M379183</link>
      <description>&lt;P&gt;I don't understand your question. Could you post some data and desired output ?&lt;/P&gt;
&lt;P&gt;Here might be what you are looking for ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
do d_birth='01jan2024'd to '02dec2025'd by 30;
 middle_year=intnx('year.7',date(),0,'e');
 want=floor(YRDIF(d_birth,middle_year,"AGE"));
 output;
end;
format d_birth middle_year  date9.;
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1767944111310.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/112556i0338D0CB4D6A43EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1767944111310.png" alt="Ksharp_0-1767944111310.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 07:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981747#M379183</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-01-09T07:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating age</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981751#M379184</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;6,30&lt;/PRE&gt;
&lt;P&gt;instead of&lt;/P&gt;
&lt;PRE&gt;12,31&lt;/PRE&gt;
&lt;P&gt;in the MDY function?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 08:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-age/m-p/981751#M379184</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-01-09T08:59:08Z</dc:date>
    </item>
  </channel>
</rss>

