<?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 make a percent (%)  of variable values in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518158#M140191</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151600"&gt;@Barkamih&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While it may seem trivial to implement the suggestion "&lt;SPAN&gt;multiply by 100," you should remember the pitfall of numeric representation issues:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;1    data _null_;
2    a=0.07;
3    a=100*a;
4    if a&amp;gt;7 then put 'Surprise! It looks like ' a '&amp;gt; 7.';
5    run;

Surprise! It looks like 7 &amp;gt; 7.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So, use the&amp;nbsp;ROUND function to avoid such surprises:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;a=round(100*a, 1e-9);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;(in place of &lt;FONT face="courier new,courier"&gt;a=100*a;&lt;/FONT&gt; )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Dec 2018 17:21:56 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-12-03T17:21:56Z</dc:date>
    <item>
      <title>how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518062#M140154</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanna to convert the variable values&amp;nbsp;from normal to percentages.&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example, I want to have 3 of 0.03 ....&amp;nbsp;etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ibrahim&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 13:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518062#M140154</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-12-03T13:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518064#M140155</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   a=0.03;
   put a;
   format a percent.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 13:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518064#M140155</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-03T13:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518065#M140156</link>
      <description>&lt;P&gt;Use the percent. format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
x1 = .03;
format x1 percent6.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Dec 2018 13:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518065#M140156</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-03T13:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518070#M140157</link>
      <description>&lt;P&gt;thanks a lot, but I need just a number, I don't want a percent sign (%) to appear in my data?&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518070#M140157</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-12-03T14:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518073#M140158</link>
      <description>&lt;P&gt;Then multiply by 100?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518073#M140158</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-03T14:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518074#M140159</link>
      <description>&lt;P&gt;As always, post test data in the form of a datastep, and what you want to see out at the end.&amp;nbsp; Your post says nothing.&amp;nbsp; Do you have 3 or 0.03?&amp;nbsp; You don't want percent apparently from the other posts, so what do you want, 3/100=0.03?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518074#M140159</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-03T14:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518078#M140160</link>
      <description>&lt;P&gt;Proud of this one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518078#M140160</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-03T14:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518098#M140173</link>
      <description>&lt;P&gt;Don't know how you come up with them&amp;nbsp;&lt;img id="smileylol" class="emoticon emoticon-smileylol" src="https://communities.sas.com/i/smilies/16x16_smiley-lol.png" alt="Smiley LOL" title="Smiley LOL" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518098#M140173</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-03T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a percent (%)  of variable values in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518158#M140191</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151600"&gt;@Barkamih&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While it may seem trivial to implement the suggestion "&lt;SPAN&gt;multiply by 100," you should remember the pitfall of numeric representation issues:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;1    data _null_;
2    a=0.07;
3    a=100*a;
4    if a&amp;gt;7 then put 'Surprise! It looks like ' a '&amp;gt; 7.';
5    run;

Surprise! It looks like 7 &amp;gt; 7.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;So, use the&amp;nbsp;ROUND function to avoid such surprises:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;a=round(100*a, 1e-9);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;(in place of &lt;FONT face="courier new,courier"&gt;a=100*a;&lt;/FONT&gt; )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 17:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-percent-of-variable-values-in-SAS/m-p/518158#M140191</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-03T17:21:56Z</dc:date>
    </item>
  </channel>
</rss>

