<?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: How to avoiding the division by zeros ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682483#M206583</link>
    <description>&lt;P&gt;If round(premium_cost, 1) ne 0 then do.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Numerical precision, your number is likely 0.0000001 which is not equal to 0 so it still does the division. Use ROUND() to round the value for comparison. &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345969"&gt;@Itharaju&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Team ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to avoid the division with zeros So, i have written below code for it .&lt;/P&gt;
&lt;P&gt;it was not working with some variable and for those variables i am getting some big exponential number .&lt;/P&gt;
&lt;P&gt;Code was :&lt;/P&gt;
&lt;P&gt;If premium_cost ne 0 then premium_percentage=(premium_comm/premium_cost ) ;&lt;/P&gt;
&lt;P&gt;here&amp;nbsp;&lt;/P&gt;
&lt;P&gt;premium_cost is&lt;STRONG&gt;&amp;nbsp; zero&lt;/STRONG&gt; .&lt;/P&gt;
&lt;P&gt;premium_comm is&lt;STRONG&gt; 27.6&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am gettting&amp;nbsp;premium_percentage=&lt;STRONG&gt;3.106E8.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have some alternates divide function,&amp;lt;&amp;gt;, case function as well but gettting same permium_percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please kindly help me here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Itharaju.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 03:59:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-09-09T03:59:21Z</dc:date>
    <item>
      <title>How to avoiding the division by zeros ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682482#M206582</link>
      <description>&lt;P&gt;Hello Team ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to avoid the division with zeros So, i have written below code for it .&lt;/P&gt;&lt;P&gt;it was not working with some variable and for those variables i am getting some big exponential number .&lt;/P&gt;&lt;P&gt;Code was :&lt;/P&gt;&lt;P&gt;If premium_cost ne 0 then premium_percentage=(premium_comm/premium_cost ) ;&lt;/P&gt;&lt;P&gt;here&amp;nbsp;&lt;/P&gt;&lt;P&gt;premium_cost is&lt;STRONG&gt;&amp;nbsp; zero&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;premium_comm is&lt;STRONG&gt; 27.6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am gettting&amp;nbsp;premium_percentage=&lt;STRONG&gt;3.106E8.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some alternates divide function,&amp;lt;&amp;gt;, case function as well but gettting same permium_percentage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please kindly help me here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Itharaju.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 03:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682482#M206582</guid>
      <dc:creator>Itharaju</dc:creator>
      <dc:date>2020-09-09T03:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoiding the division by zeros ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682483#M206583</link>
      <description>&lt;P&gt;If round(premium_cost, 1) ne 0 then do.....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Numerical precision, your number is likely 0.0000001 which is not equal to 0 so it still does the division. Use ROUND() to round the value for comparison. &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345969"&gt;@Itharaju&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello Team ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to avoid the division with zeros So, i have written below code for it .&lt;/P&gt;
&lt;P&gt;it was not working with some variable and for those variables i am getting some big exponential number .&lt;/P&gt;
&lt;P&gt;Code was :&lt;/P&gt;
&lt;P&gt;If premium_cost ne 0 then premium_percentage=(premium_comm/premium_cost ) ;&lt;/P&gt;
&lt;P&gt;here&amp;nbsp;&lt;/P&gt;
&lt;P&gt;premium_cost is&lt;STRONG&gt;&amp;nbsp; zero&lt;/STRONG&gt; .&lt;/P&gt;
&lt;P&gt;premium_comm is&lt;STRONG&gt; 27.6&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am gettting&amp;nbsp;premium_percentage=&lt;STRONG&gt;3.106E8.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have some alternates divide function,&amp;lt;&amp;gt;, case function as well but gettting same permium_percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please kindly help me here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Itharaju.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 03:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682483#M206583</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-09T03:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoiding the division by zeros ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682521#M206594</link>
      <description>&lt;P&gt;Assuming that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;accurately identified the problem, you need to decide what to do when your variable is nearly zero.&amp;nbsp; If you want to avoid dividing for that case, you can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If round(premium_cost, 0.00000001) ne 0 then premium_percentage=(premium_comm/premium_cost ) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You may need to experiment with the number of zeros after the decimal point.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 06:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682521#M206594</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-09-09T06:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoiding the division by zeros ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682577#M206614</link>
      <description>premium_percentage=(premium_comm/premium_cost ) ;&lt;BR /&gt;==&amp;gt;&lt;BR /&gt;premium_percentage=divide(premium_comm , premium_cost ) ;</description>
      <pubDate>Wed, 09 Sep 2020 11:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-avoiding-the-division-by-zeros/m-p/682577#M206614</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-09-09T11:34:51Z</dc:date>
    </item>
  </channel>
</rss>

