<?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: What would be the numeric limit for percentage in SAS? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/752594#M80754</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/376676"&gt;@StickyRoll&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was testing SAS numeric limit for percentage calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this, it would be Num8. with format 10.8. Is there a better way to define a SAS column for percentage instead of defining format 10.8 with Num8. especially for cases like 33.333333?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Depends on what you want to see. Consider one format:&lt;/P&gt;
&lt;PRE&gt;data example;
   x=1/3;
   put x=best3.;
   put x=best4.;
   put x=best5.;
   put x=best6.;
   put x=best7.;
   put x=best8.;
   put x=best9.;
   put x=best10.;
   put x=best11.;
   put x=best12.;
   put x=best13.;
   put x=best14.;
   put x=best15.;
   put x=best16.;
   put x=best17.;
   put x=best18.;
   put x=best19.;
   put x=best20.;
run;
&lt;/PRE&gt;
&lt;P&gt;Look in the Log if you aren't familiar with the Put function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pick a format, or make one of your own, that displays things the way you want.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 14:33:26 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-07-07T14:33:26Z</dc:date>
    <item>
      <title>What would be the numeric limit for percentage in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751934#M80747</link>
      <description>&lt;P&gt;I was testing SAS numeric limit for percentage calculation.&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;40% is 0.4 in SAS Dataset
100% is 1 in SAS Dataset
33.333333% is 0.3333333 in SAS Dataset&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another Database team is going to populate percentage data for me. Now the question is, I tried testing in BASE SAS and I found out SAS can support up to 8 decimal places as followed.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;0.12345678&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There might be cases where by 100 divides by 3 will get 33.3333333.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this, it would be Num8. with format 10.8. Is there a better way to define a SAS column for percentage instead of defining format 10.8 with Num8. especially for cases like 33.333333?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 03:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751934#M80747</guid>
      <dc:creator>StickyRoll</dc:creator>
      <dc:date>2021-07-04T03:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the numeric limit for percentage in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751937#M80748</link>
      <description>&lt;P&gt;SAS uses 8 Bytes to store numbers. This allows to store 15 digits with full precision (and up to a point also numbers with 16 digits).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Formats only affect how numbers get printed. SAS will use the internally stored value for any calculation (=full precision).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at below. May-be that's going to explain to you that the problem you're raising doesn't really exist.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data demo;
  do var1=0.105, 1/3, 0.5, 1.6, 1;
    var2=var1;
    var3=var1;
    var4=var1;
    output;
  end;
  format var2 best32. var3 percent16. var4 percent16.2;
  stop;
run;

proc print data=demo;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1625370060034.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60934i6971275E1C97D2B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1625370060034.png" alt="Patrick_0-1625370060034.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 03:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751937#M80748</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T03:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the numeric limit for percentage in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751941#M80749</link>
      <description>&lt;P&gt;Not sure what your question is.&amp;nbsp; SAS stores all numbers of 64 bit floating point binary.&amp;nbsp; You can have up to about 15 decimal digits of precision with such numbers.&amp;nbsp; Are you asking how many characters they should use when transferring the data as text string?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 03:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/751941#M80749</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-04T03:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the numeric limit for percentage in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/752594#M80754</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/376676"&gt;@StickyRoll&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was testing SAS numeric limit for percentage calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this, it would be Num8. with format 10.8. Is there a better way to define a SAS column for percentage instead of defining format 10.8 with Num8. especially for cases like 33.333333?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Depends on what you want to see. Consider one format:&lt;/P&gt;
&lt;PRE&gt;data example;
   x=1/3;
   put x=best3.;
   put x=best4.;
   put x=best5.;
   put x=best6.;
   put x=best7.;
   put x=best8.;
   put x=best9.;
   put x=best10.;
   put x=best11.;
   put x=best12.;
   put x=best13.;
   put x=best14.;
   put x=best15.;
   put x=best16.;
   put x=best17.;
   put x=best18.;
   put x=best19.;
   put x=best20.;
run;
&lt;/PRE&gt;
&lt;P&gt;Look in the Log if you aren't familiar with the Put function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pick a format, or make one of your own, that displays things the way you want.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 14:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/What-would-be-the-numeric-limit-for-percentage-in-SAS/m-p/752594#M80754</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-07T14:33:26Z</dc:date>
    </item>
  </channel>
</rss>

