<?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: Error when trying to convert to percent in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595490#M15816</link>
    <description>&lt;P&gt;In your code, where you have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"Percent X"*100&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the text inside the quotes is a character string which cannot be used in arithmetic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;percent_x=percent_x*100;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;note that percent_x is a variable name, it is not in quotes, and it contains an underscore instead of a space as you originally wrote it, but this method does not append a % character after the number ... so ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;probably better is to leave the value unchanged, do not perform the above step, and instead apply the PERCENTw.d format to the variable percent_x, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format percent_x percent8.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which makes the value of the variable appear as if it had been multiplied by 100 and appends a % character after the number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 16:55:11 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-10-10T16:55:11Z</dc:date>
    <item>
      <title>Error when trying to convert to percent</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595487#M15813</link>
      <description>&lt;P&gt;hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do a simply conversion from decimal to percent (ex: .91 to 91%) so I am trying to multiply my variable by 100, but I keep getting these errors:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Invalid numeric data, 'Percent_X' , at line 1343 column 28.&lt;BR /&gt;NOTE: Invalid numeric data, 'Percent_Y' , at line 1344 column 26.&lt;BR /&gt;NOTE: Invalid numeric data, 'Percent_Z' , at line 1345 column 16.&lt;/P&gt;&lt;P&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;BR /&gt;Each place is given by: (Number of times) at (Line):(Column).&lt;BR /&gt;75 at 1343:54 75 at 1344:51 75 at 1345:30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;Percent_X = "Percent_X" * 100 ;&lt;BR /&gt;Percent_Y = "Percent_Y" * 100;&lt;BR /&gt;Percent_Z = "Percent_Z" * 100;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595487#M15813</guid>
      <dc:creator>marleeakerson</dc:creator>
      <dc:date>2019-10-10T16:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to convert to percent</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595489#M15815</link>
      <description>&lt;P&gt;Try removing the quotes around variable names if they are actually variable names&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could just FORMAT the values using percent. format like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format&amp;nbsp;Percent_X&amp;nbsp; percent.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595489#M15815</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-10-10T16:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error when trying to convert to percent</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595490#M15816</link>
      <description>&lt;P&gt;In your code, where you have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"Percent X"*100&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the text inside the quotes is a character string which cannot be used in arithmetic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;percent_x=percent_x*100;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;note that percent_x is a variable name, it is not in quotes, and it contains an underscore instead of a space as you originally wrote it, but this method does not append a % character after the number ... so ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;probably better is to leave the value unchanged, do not perform the above step, and instead apply the PERCENTw.d format to the variable percent_x, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format percent_x percent8.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which makes the value of the variable appear as if it had been multiplied by 100 and appends a % character after the number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 16:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-when-trying-to-convert-to-percent/m-p/595490#M15816</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-10T16:55:11Z</dc:date>
    </item>
  </channel>
</rss>

