<?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 How to create a categorical age variable based on separate variables month and year of birth? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-categorical-age-variable-based-on-separate/m-p/879805#M347575</link>
    <description>&lt;P&gt;I have 2 separate variables for age, month and year of birth. I want to categorize it into (40-49, 50-59, 60+).&amp;nbsp; I am not sure how to format this new variable? I do not have day of birth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 17:10:56 GMT</pubDate>
    <dc:creator>racekarrz2</dc:creator>
    <dc:date>2023-06-08T17:10:56Z</dc:date>
    <item>
      <title>How to create a categorical age variable based on separate variables month and year of birth?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-categorical-age-variable-based-on-separate/m-p/879805#M347575</link>
      <description>&lt;P&gt;I have 2 separate variables for age, month and year of birth. I want to categorize it into (40-49, 50-59, 60+).&amp;nbsp; I am not sure how to format this new variable? I do not have day of birth.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 17:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-categorical-age-variable-based-on-separate/m-p/879805#M347575</guid>
      <dc:creator>racekarrz2</dc:creator>
      <dc:date>2023-06-08T17:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a categorical age variable based on separate variables month and year of birth?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-categorical-age-variable-based-on-separate/m-p/879808#M347577</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443484"&gt;@racekarrz2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have 2 separate variables for age, month and year of birth. I want to categorize it into (40-49, 50-59, 60+).&amp;nbsp; I am not sure how to format this new variable? I do not have day of birth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to assume some day of the month for their BIRTH to generate a DATE OF BIRTH. Perhaps the first of the month?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need a second DATE to be able to calculate AGE from a DATE OF BIRTH.&amp;nbsp; &amp;nbsp;Perhaps the day you run the program?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  dob = mdy(month,1,year);
  age = intnx('year',dob,today(),'s');
  format dob date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To analyze the age groups create a format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value agegrp
 low-39='Too young'
 40-50='40-50'
 50-59='50-59'
 60-high='60+'
 other='Invalid Age'
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2023 17:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-categorical-age-variable-based-on-separate/m-p/879808#M347577</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-08T17:22:49Z</dc:date>
    </item>
  </channel>
</rss>

