<?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 doesn't work in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22492#M4935</link>
    <description>Hi there, &lt;BR /&gt;
&lt;BR /&gt;
Thank you for your fast reply , but I still get this error below &lt;BR /&gt;
-------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
data table1(drop=charId);&lt;BR /&gt;
set table0(rename=(id=charId));&lt;BR /&gt;
ERROR: Variable id is not on file WORK.table1.&lt;BR /&gt;
ERROR: Invalid DROP, KEEP, or RENAME option on file WORK.table1.&lt;BR /&gt;
id=input(charId,11.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;
&lt;BR /&gt;
WARNING: The data set WORK.table1 may be incomplete.  When this step was stopped there were 0 observations and 1 variables.&lt;BR /&gt;
WARNING: Data set WORK.table1 was not replaced because this step was stopped.&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: iamjeannie

Message was edited by: iamjeannie</description>
    <pubDate>Tue, 26 Oct 2010 12:17:48 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-10-26T12:17:48Z</dc:date>
    <item>
      <title>input function doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22490#M4933</link>
      <description>I have trying to convert id from text $37 to number 11. , &lt;BR /&gt;
I'm not sure why input function doesn't work in my case , any idea ? &lt;BR /&gt;
Here's the code &lt;BR /&gt;
&lt;BR /&gt;
----------------------------------&lt;BR /&gt;
data table1;&lt;BR /&gt;
set table0;&lt;BR /&gt;
id= input(id,11.);&lt;BR /&gt;
run;&lt;BR /&gt;
---------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;
---------------------------------------------------------------------------------------------------------------- &lt;BR /&gt;
however I know that the " id" was character not numeric in table0&lt;BR /&gt;
&lt;BR /&gt;
----------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
I also tried this code below , but it also doesn' t work. &lt;BR /&gt;
&lt;BR /&gt;
data table1&lt;BR /&gt;
set table0 ;&lt;BR /&gt;
id= id*1;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 26 Oct 2010 07:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22490#M4933</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-26T07:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: input function doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22491#M4934</link>
      <description>Hi There,&lt;BR /&gt;
&lt;BR /&gt;
The reason why it doesn't work is because the variable id (from the table0 dataset) is character and at compile time the PDV is set up with id being character. The first instance the compiler comes across the id variable is with the set statement.&lt;BR /&gt;
&lt;BR /&gt;
So when you attempt to do the assignment statement the right hand side is a numeric value but the left hand side, the id variable, is defined as character - that is why you get the "NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column)."&lt;BR /&gt;
&lt;BR /&gt;
What you need to do is create a new variable that is numeric and drop your character id variable from your data set. Below is some code that I hope helps.&lt;BR /&gt;
&lt;BR /&gt;
data table1(drop=charId);&lt;BR /&gt;
	set table0(rename=(id=charId));&lt;BR /&gt;
	id=input(charId,11.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Cheers,&lt;BR /&gt;
Michelle</description>
      <pubDate>Tue, 26 Oct 2010 10:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22491#M4934</guid>
      <dc:creator>MHomes</dc:creator>
      <dc:date>2010-10-26T10:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: input function doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22492#M4935</link>
      <description>Hi there, &lt;BR /&gt;
&lt;BR /&gt;
Thank you for your fast reply , but I still get this error below &lt;BR /&gt;
-------------------------------------------------------------------------------------------------------------&lt;BR /&gt;
data table1(drop=charId);&lt;BR /&gt;
set table0(rename=(id=charId));&lt;BR /&gt;
ERROR: Variable id is not on file WORK.table1.&lt;BR /&gt;
ERROR: Invalid DROP, KEEP, or RENAME option on file WORK.table1.&lt;BR /&gt;
id=input(charId,11.);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;
&lt;BR /&gt;
WARNING: The data set WORK.table1 may be incomplete.  When this step was stopped there were 0 observations and 1 variables.&lt;BR /&gt;
WARNING: Data set WORK.table1 was not replaced because this step was stopped.&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: iamjeannie

Message was edited by: iamjeannie</description>
      <pubDate>Tue, 26 Oct 2010 12:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22492#M4935</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-26T12:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: input function doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22493#M4936</link>
      <description>Something about your SAS log does not make sense - suggest you reply to your post and paste the "entire SAS log".&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 26 Oct 2010 13:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22493#M4936</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-26T13:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: input function doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22494#M4937</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Scott. Something strange is happening. As you can see from my log, below, when I create TABLE0 with a character ID variable and then create TABLE1 using the rename/INPUT technique, I do not get the same error messages, so somehow, something is "off".&lt;BR /&gt;
[pre]&lt;BR /&gt;
92   data table0;&lt;BR /&gt;
93     id = '12345678901';&lt;BR /&gt;
94     numvar = 1234;&lt;BR /&gt;
95   run;&lt;BR /&gt;
                     &lt;BR /&gt;
NOTE: The data set WORK.TABLE0 has 1 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
              &lt;BR /&gt;
                 &lt;BR /&gt;
96&lt;BR /&gt;
97&lt;BR /&gt;
98&lt;BR /&gt;
99   data table1(drop=charId);&lt;BR /&gt;
100  set table0(rename=(id=charId));&lt;BR /&gt;
101  id=input(charId,11.);&lt;BR /&gt;
102  put _all_;&lt;BR /&gt;
103  run;&lt;BR /&gt;
                    &lt;BR /&gt;
charId=12345678901 numvar=1234 id=12345678901 _ERROR_=0 _N_=1&lt;BR /&gt;
NOTE: There were 1 observations read from the data set WORK.TABLE0.&lt;BR /&gt;
NOTE: The data set WORK.TABLE1 has 1 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.04 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                         &lt;BR /&gt;
In additions to Scott's suggestion, I'd recommend going back a bit farther to where TABLE0 is created and do a PROC CONTENTS on TABLE0 to make sure that all the variables in the dataset are in the form that you expect them to be.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 26 Oct 2010 15:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/input-function-doesn-t-work/m-p/22494#M4937</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-26T15:31:03Z</dc:date>
    </item>
  </channel>
</rss>

