Date: Fri, 14 Mar 2003 18:22:55 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: ERROR: INPUT function requires a character argument. ??
Content-Type: text/plain; charset=us-ascii
You get a similar message in the data step; it tells you that numeric
values have been converted to character (the implicit conversion messag
which is frequently mentioned here).
You created an informat with the INVALUE DOSLEV statement, and an input
format *always* expects to read a character value. In the data step,
your numeric 5 is being converted to a character "5", and then that
character "5" is being run through the informat.
SQL won't do that implicit conversion for you; instead, it gives an
error message.
I'd like SAS to add an option which treats implicit conversions in the
data step as errors.
--
JackHamilton@FirstHealth.com
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "Huang, Ya" <yhuang@AMYLIN.COM> 03/14/2003 4:50 PM >>>
Hi,
It seems to me that input function behaves differently
between data step and sql:
proc format;
invalue doslev
1,2,3 = 0.02
4,5,6 = 0.04
;
run;
data _null_;
a=5;
b=input(a,doslev.);
put a= b=;
run;
data xx;
a=5;
run;
proc sql;
select a, input(a, doslev.) as b
from xx;
For the data step, everything seems OK,
but for the sql, I got the following error message:
ERROR: INPUT function requires a character argument
Isn't it strange?
Ya