<?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 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57169#M12304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The message implies that the input function needs to convert the input parameter to Char, before it applies the numerical format - and the end result of the input function numerical.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Feb 2012 13:13:23 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2012-02-17T13:13:23Z</dc:date>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57168#M12303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone explain about why Input function displays the message in the log: NOTE: Numeric values have been converted to character values at the places given by: &lt;/P&gt;&lt;P&gt;but in the actual dataset it is not converting the value. As per the functionality of Input function, it should convert character to Numeric. It is quite confusing........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;set _prodsavail;&lt;/P&gt;&lt;P&gt;dd=input(licensed,12.);&amp;nbsp;&amp;nbsp;&amp;nbsp; /*licensed is a Numeric variable*/&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 13:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57168#M12303</guid>
      <dc:creator>LHV</dc:creator>
      <dc:date>2012-02-17T13:09:28Z</dc:date>
    </item>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57169#M12304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The message implies that the input function needs to convert the input parameter to Char, before it applies the numerical format - and the end result of the input function numerical.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 13:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57169#M12304</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-02-17T13:13:23Z</dc:date>
    </item>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57170#M12305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i use below statement, it is giving the 'dd' as character, in that case what is the difference between INPUT and PUT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;dd=input(licensed,$12.);&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;Thnaks,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 13:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57170#M12305</guid>
      <dc:creator>LHV</dc:creator>
      <dc:date>2012-02-17T13:42:10Z</dc:date>
    </item>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57171#M12306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT will convert a character variable to numeric variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you are trying to convert the 'license' variable that is already numeric, SAS will convert it to character first prior to the conversion back to numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The PUT function will return a numeric variable as a character string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 13:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57171#M12306</guid>
      <dc:creator>pcorbridge</dc:creator>
      <dc:date>2012-02-17T13:54:07Z</dc:date>
    </item>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57172#M12307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it is confusing and I think it is an artifact of SAS's attempt to be a system that will let you work with character and numeric variables without having to distinguish between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was a valiant effort, but one that really couldn't hold up given the complexity of the various functions, procs, formats and informats that have evolved over the years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the safest rule of thumb is to use the input function ONLY when converting from characters to numeric, and ONLY use put when converting from numeric to character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way you won't get the annoying messages in your log and you won't run into brick walls when the character/numeric distinction can't be avoided.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 13:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57172#M12307</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-17T13:58:38Z</dc:date>
    </item>
    <item>
      <title>Input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57173#M12308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you actually trying to do?&lt;/P&gt;&lt;P&gt;If you just want to assign the value of licensed to dd then you do not need a function.&lt;/P&gt;&lt;P&gt;If you want to convert the numeric variable licensed to a character value then use the PUT function instead of the INPUT function.&lt;/P&gt;&lt;P&gt;PUT always generates character result.&lt;/P&gt;&lt;P&gt;INPUT results depends on the type of the informat used.&amp;nbsp; That is why $12. generates character variables and 12. generates a numeric variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are also PUTN, PUTC, INPUTN and INPUTC which have been added over the years.&amp;nbsp; They have the advantage of allowing the format/informat to come from a variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Feb 2012 14:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input/m-p/57173#M12308</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-17T14:35:00Z</dc:date>
    </item>
  </channel>
</rss>

