<?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 function: convert character to numeric in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348751#M80787</link>
    <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got a silly question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when converting a character to numeric, and the decimal informat is used, we will get a float, not a integer the same as the original character. what is going on behind the sence?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;ch="15"; &amp;nbsp;* we do not have decimal here;&lt;BR /&gt;n=input(ch,8.2); * why we get n=0.15 not n=15 ? anyone can help to explain? ;&lt;BR /&gt;run;&lt;BR /&gt;proc print width=min;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;why we get n=0.15 not n=15 ? anyone can help to explain? ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 15:37:41 GMT</pubDate>
    <dc:creator>ifendo</dc:creator>
    <dc:date>2017-04-10T15:37:41Z</dc:date>
    <item>
      <title>input function: convert character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348751#M80787</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i got a silly question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when converting a character to numeric, and the decimal informat is used, we will get a float, not a integer the same as the original character. what is going on behind the sence?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;ch="15"; &amp;nbsp;* we do not have decimal here;&lt;BR /&gt;n=input(ch,8.2); * why we get n=0.15 not n=15 ? anyone can help to explain? ;&lt;BR /&gt;run;&lt;BR /&gt;proc print width=min;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;why we get n=0.15 not n=15 ? anyone can help to explain? ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348751#M80787</guid>
      <dc:creator>ifendo</dc:creator>
      <dc:date>2017-04-10T15:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: input function: convert character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348758#M80790</link>
      <description>&lt;P&gt;Technically, the meaning of the 8.2 informat is this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the incoming character string, read 8 characters.&amp;nbsp; See if they contain a decimal point.&amp;nbsp; If they do, then respect the decimal point.&amp;nbsp; If they don't contain a decimal point, assume that the last two digits belong after the decimal point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to read the characters as is and convert to numeric, use the 8. informat instead.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 15:43:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348758#M80790</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-10T15:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: input function: convert character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348968#M80870</link>
      <description>thank you very much.</description>
      <pubDate>Tue, 11 Apr 2017 04:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-function-convert-character-to-numeric/m-p/348968#M80870</guid>
      <dc:creator>ifendo</dc:creator>
      <dc:date>2017-04-11T04:20:05Z</dc:date>
    </item>
  </channel>
</rss>

