<?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 add % symbol to numeric values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575264#M162683</link>
    <description>&lt;P&gt;Hello&lt;BR /&gt;I have numeric values that present percentage.&lt;BR /&gt;I want to add % symbol to each of the numbers.&lt;BR /&gt;For example: instead of 2.14 we will see (format) 2.14%&lt;BR /&gt;I know to it by divide each number by 100 and then format it with percent9.2&lt;BR /&gt;My question is if there is another way to do it without divide by 100&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x1 x2 x3;
cards;
2.14	2.46	3.3
19.83	18.57	18.06
35.43	33.39	36.44
3.66	2.73	4.68
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Jul 2019 05:38:42 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2019-07-22T05:38:42Z</dc:date>
    <item>
      <title>add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575264#M162683</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I have numeric values that present percentage.&lt;BR /&gt;I want to add % symbol to each of the numbers.&lt;BR /&gt;For example: instead of 2.14 we will see (format) 2.14%&lt;BR /&gt;I know to it by divide each number by 100 and then format it with percent9.2&lt;BR /&gt;My question is if there is another way to do it without divide by 100&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x1 x2 x3;
cards;
2.14	2.46	3.3
19.83	18.57	18.06
35.43	33.39	36.44
3.66	2.73	4.68
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jul 2019 05:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575264#M162683</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-07-22T05:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575267#M162685</link>
      <description>Symbols are never part of a value, they can only be displayed by using formats.</description>
      <pubDate>Mon, 22 Jul 2019 05:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575267#M162685</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-22T05:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575271#M162689</link>
      <description>&lt;P&gt;Sure.&lt;/P&gt;
&lt;P&gt;The question is how to perform format such that the values will be displayed with %&lt;/P&gt;
&lt;P&gt;for example: value 2.14 will be displayed as 2.14%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575271#M162689</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-07-22T06:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575272#M162690</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sure.&lt;/P&gt;
&lt;P&gt;The question is how to perform format such that the values will be displayed with %&lt;/P&gt;
&lt;P&gt;for example: value 2.14 will be displayed as 2.14%&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You already have the most convenient method in your initial post: divide by 100 and apply percent-format. A bit more arcane: you could define a picture format adding % and apply that.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575272#M162690</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-22T06:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575274#M162692</link>
      <description>&lt;P&gt;I want also to learn the way with proc format picture .&lt;/P&gt;
&lt;P&gt;As you can see in data set c the values are not displayed as I want.&lt;/P&gt;
&lt;P&gt;I cannot see the % symbol and for example instead of see&amp;nbsp; 2.14% I see&amp;nbsp; 2&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x1 x2 x3;
cards;
2.14	2.46	3.3
19.83	18.57	18.06
35.43	33.39	36.44
3.66	2.73	4.68
;
run;

proc format;
picture mypct (round) low-high='009.99%'; 
run;

data c;
set a;
format x1 x2 x3 mypct.;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575274#M162692</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-07-22T06:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575275#M162693</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;My question is if there is another way to do it without divide by 100"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you're in the mood for unnecessary work, create a custom picture format.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Keep in mind that it makes sense to store 1 percent as 0.01, as it enables you to do percent calculations without the (otherwise needed) division by 100.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575275#M162693</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-22T06:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575276#M162694</link>
      <description>&lt;P&gt;I just don't understand why the format that I created cannot be seen in data set C&amp;nbsp; and I can only see it when&amp;nbsp; I use proc print&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data c;
set a;
format x1 x2 x3 mypct.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jul 2019 06:41:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575276#M162694</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-07-22T06:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575292#M162700</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just don't understand why the format that I created cannot be seen in data set C&amp;nbsp; and I can only see it when&amp;nbsp; I use proc print&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data c;
set a;
format x1 x2 x3 mypct.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Start reading the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm" target="_self"&gt;docs&lt;/A&gt; to avoid such problems. The %-sign is always the first char of a special-formatting directive. The docs will tell you how to fix this.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 07:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575292#M162700</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-07-22T07:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575403#M162753</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want also to learn the way with proc format picture .&lt;/P&gt;
&lt;P&gt;As you can see in data set c the values are not displayed as I want.&lt;/P&gt;
&lt;P&gt;I cannot see the % symbol and for example instead of see&amp;nbsp; 2.14% I see&amp;nbsp; 2&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x1 x2 x3;
cards;
2.14	2.46	3.3
19.83	18.57	18.06
35.43	33.39	36.44
3.66	2.73	4.68
;
run;

proc format;
picture mypct (round) low-high='009.99%'; 
run;

data c;
set a;
format x1 x2 x3 mypct.;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you think the ROUND above does? Why did you include it if you want two decimal places?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It rounds the value to nearest integer so the result is what you told it to provide.&lt;/P&gt;
&lt;P&gt;You would likely be better off using a ROUND function on the value to set the desired decimals and then apply a format without the round as part of the definition.&lt;/P&gt;
&lt;P&gt;Or use a real percent value&amp;nbsp;and the Percent format.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 14:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575403#M162753</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-22T14:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575434#M162768</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;                           
   picture mypct (round) low-high='009.99%';   
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/38/001.html" target="_blank"&gt;http://support.sas.com/kb/38/001.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is correct, if it's not working, show how you're using it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;BR /&gt;I have numeric values that present percentage.&lt;BR /&gt;I want to add % symbol to each of the numbers.&lt;BR /&gt;For example: instead of 2.14 we will see (format) 2.14%&lt;BR /&gt;I know to it by divide each number by 100 and then format it with percent9.2&lt;BR /&gt;My question is if there is another way to do it without divide by 100&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x1 x2 x3;
cards;
2.14	2.46	3.3
19.83	18.57	18.06
35.43	33.39	36.44
3.66	2.73	4.68
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 16:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575434#M162768</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-22T16:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: add % symbol to numeric values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575436#M162770</link>
      <description>&lt;P&gt;Because that's code from the SAS website, not from the OP and s/he likely doesn't understand it yet.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;CODE class=" language-sas"&gt; &lt;/CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you think the ROUND above does? Why did you include it if you want two decimal places?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It rounds the value to nearest integer so the result is what you told it to provide.&lt;/P&gt;
&lt;P&gt;You would likely be better off using a ROUND function on the value to set the desired decimals and then apply a format without the round as part of the definition.&lt;/P&gt;
&lt;P&gt;Or use a real percent value&amp;nbsp;and the Percent format.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2019 16:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-symbol-to-numeric-values/m-p/575436#M162770</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-22T16:09:48Z</dc:date>
    </item>
  </channel>
</rss>

