<?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: Input function in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294622#M61478</link>
    <description>&lt;P&gt;Jim identified the right issue. &amp;nbsp;To make S a character variable, you could try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input s $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then just as a learning experience, I would suggest you add to the program and also test:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;s3 = input(s, 3.1);&lt;/P&gt;</description>
    <pubDate>Sun, 28 Aug 2016 12:19:04 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-08-28T12:19:04Z</dc:date>
    <item>
      <title>Input function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294617#M61476</link>
      <description>&lt;P&gt;I want to check the output of using the input funcion, the following is my codes:&lt;/P&gt;
&lt;PRE&gt;DATA a;
INPUT s ;
s2=input(s,3.0);
DATALINES;
5
6
001
2.3
;
RUN;&lt;/PRE&gt;
&lt;P&gt;it returns a missing value for s2. I can't find the error in my codes, could anyone help me?&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4740iB35687663DDEEBAA/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="2016-08-28_115640.png" title="2016-08-28_115640.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 09:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294617#M61476</guid>
      <dc:creator>DingDing</dc:creator>
      <dc:date>2016-08-28T09:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Input function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294621#M61477</link>
      <description>&lt;P&gt;Line 2 of your code: &amp;nbsp; Input s ;&amp;nbsp;&amp;nbsp;&amp;nbsp; Makes s a numeric variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try on line 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s2 = put(s,3.0);&amp;nbsp;&amp;nbsp; * converts s (numeric) to a character variable s2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 12:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294621#M61477</guid>
      <dc:creator>Jim_G</dc:creator>
      <dc:date>2016-08-28T12:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Input function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294622#M61478</link>
      <description>&lt;P&gt;Jim identified the right issue. &amp;nbsp;To make S a character variable, you could try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input s $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then just as a learning experience, I would suggest you add to the program and also test:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;s3 = input(s, 3.1);&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 12:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294622#M61478</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-08-28T12:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: Input function in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294625#M61481</link>
      <description>&lt;P&gt;Because you are referencing a numeric variable where SAS expects a character value it is automatically converting the number into a character string for you. &amp;nbsp;It will use the BEST12. format to do this. So your when you read only the first three characters using 3.0 informat your will be reading only the leading spaces of the right aligned 12 character values.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 13:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-function-in-SAS/m-p/294625#M61481</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-08-28T13:01:36Z</dc:date>
    </item>
  </channel>
</rss>

