<?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 Statement Not Turning Blue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698924#M213788</link>
    <description>Unfortunately I don't think the code is working--the log makes no mention of "character values were changed to numeric" or anything like that, and then the data set reports out with 0 observations. I was describing the color to indicate that I think there is a specific problem with the input function after an equal sign, as it turns blue and my log is correct when I use input as the first word in the line of code.&lt;BR /&gt;Thank you for pointing out the INFORMAT mistake--I made that change but it still doesn't seem to be fixing the problem.</description>
    <pubDate>Sun, 15 Nov 2020 00:35:32 GMT</pubDate>
    <dc:creator>camigyrl161</dc:creator>
    <dc:date>2020-11-15T00:35:32Z</dc:date>
    <item>
      <title>Input Statement Not Turning Blue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698920#M213785</link>
      <description>&lt;P&gt;I am trying to convert a character variable to a numeric variable using the input statement. It is the first line of my code after importing my data and running proc contents. However, when I use the code below, the 'input' does not turn blue, and nothing changes in my log or resulting proc contents when I run the code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*change character variable to numeric;&lt;/P&gt;&lt;P&gt;data work.dtgdata1;&lt;BR /&gt;set library.dtgdata;&lt;BR /&gt;hiv_years = input(hivyears, $3.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Input' will turn blue if it is written at the beginning of a line of code, but not after an equal sign, and I'm not sure what other methods to use to create a numeric variable. If someone could offer some insight about this I would appreciate it!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Nov 2020 23:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698920#M213785</guid>
      <dc:creator>camigyrl161</dc:creator>
      <dc:date>2020-11-14T23:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Not Turning Blue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698923#M213787</link>
      <description>&lt;P&gt;I'd wouldn't get too hung up on SAS editor colour coding. The proof in whether your program works or not is in your SAS log and output - no errors, warnings and the expected output is found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, your INPUT function should use a numeric INFORMAT (no dollar sign) if you want a numeric result: hiv_years = input(hivyears, 3.);&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 00:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698923#M213787</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-15T00:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Not Turning Blue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698924#M213788</link>
      <description>Unfortunately I don't think the code is working--the log makes no mention of "character values were changed to numeric" or anything like that, and then the data set reports out with 0 observations. I was describing the color to indicate that I think there is a specific problem with the input function after an equal sign, as it turns blue and my log is correct when I use input as the first word in the line of code.&lt;BR /&gt;Thank you for pointing out the INFORMAT mistake--I made that change but it still doesn't seem to be fixing the problem.</description>
      <pubDate>Sun, 15 Nov 2020 00:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698924#M213788</guid>
      <dc:creator>camigyrl161</dc:creator>
      <dc:date>2020-11-15T00:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Not Turning Blue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698928#M213790</link>
      <description>&lt;P&gt;Since your program appears to have other issues please post your SAS log of the complete program and not just the last step.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 02:13:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698928#M213790</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-15T02:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Input Statement Not Turning Blue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698931#M213792</link>
      <description>&lt;P&gt;Your program does not have an input statement. Instead you have an assignment state where the value being assigned is the result of the INPUT() function.&amp;nbsp; It is not clear&amp;nbsp;what editor you are using, but the SAS Display Manager's "enchanced" editor does not color code function names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You INPUT function call is just taking the first three characters from the variable HIVYEARS.&amp;nbsp; The $ informat simply converts text into text. It would be clearer to use the substr() function (or the newer substrn() function).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;hiv_years = substr(hivyears,1,3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 02:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-Statement-Not-Turning-Blue/m-p/698931#M213792</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-15T02:44:31Z</dc:date>
    </item>
  </channel>
</rss>

