I can't believe that you are using that code really! Id like to see your
log for that. I think, some semicolons would help there.
Maybe something like that:
data x ;
set x ;
if variable lt 0 then delete;
but in comparing chars with numerics, sometimes unexpected results may
On Wed, 10 Sep 2003 08:54:49 +0200, Groeneveld, Jim
>You have a character variable Variable, so in principle you may not use
expressions and conditions where its numerical value is needed. However,
SAS in such cases performs implicit type conversion (in memory) in order to
process the statement. But as you have text as values from the variable
('#n/a') that can not be converted appropriately and thus will not succeed.
You'll have to base your condition(s) upon the literal text(s), occurring
as a representation of missing values, thus '#n/a' or maybe '#N/A' or
even 'n/a' and the like as well if those values also occur. For SAS that is
just literal text without any known meaning. If you do not yet succeed in
deleting all records with what you defined as missing values for that
Variable then call again and provide some code and some sample data as well.
>Regards - Jim.
>Y. (Jim) Groeneveld MSc
>6825 MJ Arnhem
>+31/0 26 376 7365; fax 7305
>From: tin-shun-jimmy chan [mailto:jimmy.chan@HEC.CA]
>Sent: Wednesday, September 10, 2003 01:02
>Subject: any ideas...
>I want to delete some observations with #n/a from observations with
>numeric data (but in character format). I have succeeded to delete part
>of the #n/a observations with
>if variable = '#n/a' then delete;
>but not all #n/a. So I use the following codes:
>if variable lt 0 then delete;
>and it doesn't work. In opposite, I use the 'where' function at the
>menu bar with the instruction 'variable lt 0' to find the #n/a
>observations and SAS did find it for me. So could you tell me why i
>couldn't delete it with my codes. Hope that you understand my question.