Date: Fri, 4 Jul 2008 22:18:16 -0400
Reply-To: Alison El Ayadi <alisontetler@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alison El Ayadi <alisontetler@YAHOO.COM>
Subject: NOTE: Invalid argument to function INPUT
I am bringing in some survey data from survey monkey, so it is all in text
format. To make it easier to work with I'm trying to switch everything to
numeric. I have recoded all of my variables in the same manner as the
example below, but each time I try to run it I get an error that says:
NOTE: Invalid argument to function INPUT at line 11070 column 7.
I have gone through the frequencies of my old variables and they have all
been changed, although the freq tables look a little funny with the
variable values a little lower than the descriptive statistics on the page
(I think this is due to the fact that they are numbers but in a character
format).
I have seen the suggestions that others have posted regarding this error,
that there is still something character that is left in the variable, but
can't find anything. Does anyone have any suggestions??
Thanks so much,
Alison
**here is a sample of the way I am recoding to numeric and then formatting
into a numeric variable:
data apa; set surveys.apa; options nofmterr;
If In_what_state_do_you_work____che = 'Connecticut' then
In_what_state_do_you_work____che = 1;
else if In_what_state_do_you_work____che = 'Maine' then
In_what_state_do_you_work____che = 2;
else if In_what_state_do_you_work____che = 'Massachusetts' then
In_what_state_do_you_work____che = 3;
else if In_what_state_do_you_work____che = 'New Hampshire' then
In_what_state_do_you_work____che = 4;
else if In_what_state_do_you_work____che = 'Rhode Island' then
In_what_state_do_you_work____che = 5;
else if In_what_state_do_you_work____che = 'Vermont' then
In_what_state_do_you_work____che = 6;
else In_what_state_do_you_work____che = 0;
State = input(In_what_state_do_you_work____che,best4.);