<?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: SAS Code Help: Case Statement Logic seems to not be working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731483#M227848</link>
    <description>&lt;P&gt;I wish I could thank you a million times! That worked perfectly&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 23:22:54 GMT</pubDate>
    <dc:creator>Pattyp33</dc:creator>
    <dc:date>2021-04-05T23:22:54Z</dc:date>
    <item>
      <title>SAS Code Help: Case Statement Logic seems to not be working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731479#M227846</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry if I miss any details for what I'm trying to achieve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I work with confidential data so I won't be able to post the details here but I'm running into an issue where my case statement is assigning a value to one bucket when it should be a different one.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a piece of code that calculates the % of the limit a member met:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;( DEDUCTIBLE_MEDICAL / FAMILY_DED ) =&amp;nbsp;MED_PERCENT_DEDUCTIBLE FORMAT PERCENT.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DEDUCTIBLE_MEDICAL = the $ amount someone incurred&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FAMILY_DED = a fixed value based on the product the member is in&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then I use this calculated field (MED_PERCENT_DEDUCTIBLE) to use in a case statement:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CASE 
	WHEN MED_PERCENT_DEDUCTIBLE &amp;lt;= 0 THEN 'No Deductible'
	WHEN 0 &amp;lt; MED_PERCENT_DEDUCTIBLE &amp;lt;= .25 THEN '1st Quartile'
	WHEN .25 &amp;lt; MED_PERCENT_DEDUCTIBLE &amp;lt;= .50 THEN '2nd Quartile'
	WHEN .50 &amp;lt; MED_PERCENT_DEDUCTIBLE &amp;lt;= .75 THEN '3rd Quartile'
	WHEN .75 &amp;lt; MED_PERCENT_DEDUCTIBLE &amp;lt; 1 THEN '4th Quartile'
	WHEN MED_PERCENT_DEDUCTIBLE &amp;gt;= 1 THEN 'Hit Deductible'
END AS MED_DEDUCTIBLE_STATUS,&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For this example I have someone who has a total of $3,000 for their &lt;SPAN&gt;DEDUCTIBLE_MEDICAL &lt;/SPAN&gt;&lt;SPAN&gt;and the FAMILY_DED assigned to them is also $3,000. So based on the calculation, the members MED_PERCENT_DEDUCTIBLE is equal to 1. Based on the case statement I would assume that they would be in the bucket "Hit Deductible" but they are being assigned to the "4th Quartile" bucket instead.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts on why this could be? My assumption is that the case statement logic needs to be adjusted but I can't figure out what in particular needs to be changed&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts or advise would be greatly appreciated!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 22:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731479#M227846</guid>
      <dc:creator>Pattyp33</dc:creator>
      <dc:date>2021-04-05T22:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code Help: Case Statement Logic seems to not be working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731481#M227847</link>
      <description>&lt;P&gt;Looks like a numeric precision problem to me. The problem percentage calculation is likely very close to 1 but is not exact. Maybe rounding the result will help:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;MED_PERCENT_DEDUCTIBLE = round(( DEDUCTIBLE_MEDICAL / FAMILY_DED ), 0.01) &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Apr 2021 22:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731481#M227847</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-04-05T22:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code Help: Case Statement Logic seems to not be working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731483#M227848</link>
      <description>&lt;P&gt;I wish I could thank you a million times! That worked perfectly&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 23:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Code-Help-Case-Statement-Logic-seems-to-not-be-working/m-p/731483#M227848</guid>
      <dc:creator>Pattyp33</dc:creator>
      <dc:date>2021-04-05T23:22:54Z</dc:date>
    </item>
  </channel>
</rss>

