<?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 Assign category to max age below 24Months in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-category-to-max-age-below-24Months/m-p/698547#M33693</link>
    <description>&lt;P&gt;Hi, I want to assign category to the ID 1234 if age &amp;lt; =24. In the below example I have 3 rows in this ID which satisfies the condition.&lt;/P&gt;&lt;P&gt;But I want the category to be assigned to the max age (only) available below 24 months, In this case it is 12 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition for version is either 0 or 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't figure out how to get this done. Please advise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Age in months&lt;/TD&gt;&lt;TD&gt;Version&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;0.032854209&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 22:03:07 GMT</pubDate>
    <dc:creator>bharath86</dc:creator>
    <dc:date>2020-11-12T22:03:07Z</dc:date>
    <item>
      <title>Assign category to max age below 24Months</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-category-to-max-age-below-24Months/m-p/698547#M33693</link>
      <description>&lt;P&gt;Hi, I want to assign category to the ID 1234 if age &amp;lt; =24. In the below example I have 3 rows in this ID which satisfies the condition.&lt;/P&gt;&lt;P&gt;But I want the category to be assigned to the max age (only) available below 24 months, In this case it is 12 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition for version is either 0 or 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't figure out how to get this done. Please advise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Age in months&lt;/TD&gt;&lt;TD&gt;Version&lt;/TD&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;0.032854209&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 22:03:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-category-to-max-age-below-24Months/m-p/698547#M33693</guid>
      <dc:creator>bharath86</dc:creator>
      <dc:date>2020-11-12T22:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Assign category to max age below 24Months</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Assign-category-to-max-age-below-24Months/m-p/698578#M33697</link>
      <description>&lt;P&gt;I'd use a double DO loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by id age;
run;

data want;
do until (last.id);
  set have;
  by id;
  if age le 24 then maxage = max(maxage,age);
end;
do until (last.id);
  set have;
  by id;
  category = (maxage = age);
  output;
end;
drop maxage;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 06:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Assign-category-to-max-age-below-24Months/m-p/698578#M33697</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-13T06:59:15Z</dc:date>
    </item>
  </channel>
</rss>

