<?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: Convert a character variable into a numeric variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146609#M29157</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to plot thousands of pics. Those two numbers are the upper and lower bound of axes. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jan 2015 18:53:01 GMT</pubDate>
    <dc:creator>Amy_W</dc:creator>
    <dc:date>2015-01-30T18:53:01Z</dc:date>
    <item>
      <title>Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146603#M29151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created two macro variables using proc sql select into. My expectation is that I will get two numbers and then continue to next step. The part of my is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14226400157307623" jivemacro_uid="_14226400157307623"&gt;
&lt;P&gt;proc sql noprint;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; select min(mean),max(mean) &lt;/P&gt;
&lt;P&gt;&amp;nbsp; INTO :mini,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; :maxes&lt;/P&gt;
&lt;P&gt;&amp;nbsp; from plot1;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;%LET low=%eval(&amp;amp;mini-10);&lt;/P&gt;
&lt;P&gt;%LET upper=%eval(&amp;amp;maxes+10);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error messages are:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14226400531664188" jivemacro_uid="_14226400531664188"&gt;
&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; operand is required. The condition was: 290.6-10&lt;/P&gt;
&lt;P&gt;ERROR: The macro PLOT will stop executing.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know one way to use input function in data step but not sure how to achieve my goal in this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are welcome and thanks for all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 17:49:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146603#M29151</guid>
      <dc:creator>Amy_W</dc:creator>
      <dc:date>2015-01-30T17:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146604#M29152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%eval is only good for integers. replace it with %sysevalf().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 17:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146604#M29152</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-01-30T17:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146605#M29153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's it!&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146605#M29153</guid>
      <dc:creator>Amy_W</dc:creator>
      <dc:date>2015-01-30T18:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146606#M29154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;select (min(mean) -&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: SAS Monospace;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;),(max(mean)+&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: SAS Monospace;"&gt;10&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;) into : low , :upper&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;and avoid the extra step?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;Of course if you also need mini and maxes that's not needed.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146606#M29154</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-01-30T18:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146607#M29155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why put the numbers into macro variables at all?&amp;nbsp; What is your "next step"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146607#M29155</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-01-30T18:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146608#M29156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's really a good idea. Though I still need the %sysevalf function to convert it into numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146608#M29156</guid>
      <dc:creator>Amy_W</dc:creator>
      <dc:date>2015-01-30T18:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146609#M29157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to plot thousands of pics. Those two numbers are the upper and lower bound of axes. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146609#M29157</guid>
      <dc:creator>Amy_W</dc:creator>
      <dc:date>2015-01-30T18:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a character variable into a numeric variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146610#M29158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For axis scaling I would look at the IML routine GSCALE.&amp;nbsp; I it takes min and max values and produces nice tick marks using some criteria that you can adjust, like Number of Ticks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 18:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-a-character-variable-into-a-numeric-variable/m-p/146610#M29158</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-01-30T18:57:41Z</dc:date>
    </item>
  </channel>
</rss>

