<?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 Input Column that can have both character &amp;amp; number but should read number as numeric not character in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566102#M11305</link>
    <description>Hi Could you please advise how to input a single column that can have/read both character &amp;amp; number but should read number as numeric not as character. Is it possible ?</description>
    <pubDate>Fri, 14 Jun 2019 02:48:30 GMT</pubDate>
    <dc:creator>Kamal5522</dc:creator>
    <dc:date>2019-06-14T02:48:30Z</dc:date>
    <item>
      <title>Input Column that can have both character &amp; number but should read number as numeric not character</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566102#M11305</link>
      <description>Hi Could you please advise how to input a single column that can have/read both character &amp;amp; number but should read number as numeric not as character. Is it possible ?</description>
      <pubDate>Fri, 14 Jun 2019 02:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566102#M11305</guid>
      <dc:creator>Kamal5522</dc:creator>
      <dc:date>2019-06-14T02:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Input Column that can have both character &amp; number but should read number as numeric not cha</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566105#M11306</link>
      <description>&lt;P&gt;As far as I know, it is not possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is it that you are trying to achieve? Is it about how to read the input data? Then you might want to think about how to find out if it is a number or not.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	something = "-1.03";
	if compress(something,"0123456789-.,","K") = something then do;
		*It is numeric, then maybe do an input statment to remove decimal chars or what ever it is you want.;
	end;
	else do;
		*It is numeric, just let it be.;
	end;
	*You might want to check for missing values, as in " " or ".". ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it about how to use the data once it is in the table?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	something = "-1.03";
	somethingElse = something * 10;
*This works, but you get a note in the log file.
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
Better not to use it this way if you can avoid it. Maybe combine it with the above code.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 04:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566105#M11306</guid>
      <dc:creator>heffo</dc:creator>
      <dc:date>2019-06-14T04:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Input Column that can have both character &amp; number but should read number as numeric not cha</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566107#M11307</link>
      <description>&lt;P&gt;Try this - un-comment var = statements one at a time:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  var = 123;
  * var = '123';
  if vtype(var) = 'C' then varnum = input(var,best12.);
  else varnum = var;
  put _all_;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Jun 2019 04:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566107#M11307</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-06-14T04:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Input Column that can have both character &amp; number but should read number as numeric not cha</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566117#M11310</link>
      <description>&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/261618"&gt;@heffo&lt;/a&gt;&amp;nbsp; already said: this is not possible. A variable is either numeric or alphanumeric. And if i see notes like &lt;/P&gt;
&lt;PRE&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/PRE&gt;
&lt;P&gt;in a log, i would mark the code as defective.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 06:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566117#M11310</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-06-14T06:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Input Column that can have both character &amp; number but should read number as numeric not cha</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566186#M11311</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/277241"&gt;@Kamal5522&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Could you please advise how to input a single column that can have/read both character &amp;amp; number but should read number as numeric not as character. Is it possible ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Example data.&lt;/P&gt;
&lt;P&gt;If the character values are limited and&amp;nbsp;with a possibly numeric meaning such as NA or NULL that should be missing, or MAX that should be considered a specific value, then possibly. If you have actual mixed data like person names and a numeric value, then not without a lot of parsing code.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 14:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Input-Column-that-can-have-both-character-amp-number-but-should/m-p/566186#M11311</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-14T14:50:14Z</dc:date>
    </item>
  </channel>
</rss>

