|
> From: Quentin McMullen [mailto:QuentinMcMullen@WESTAT.COM]
> Dennis Diskin (and many others) have already explained:
>
> > The default format for all numeric variables in SAS is BEST8.
> > When you tell SQL to put something INTO a macro variable, it
> > must convert it to a character string
> Given that, I think I'd be happier to see SAS put a NOTE: to
> the log when it
> does the automatic numeric to character conversion for INTO,
> as done with automatic conversions in a data step.
Knot!
It's your incorrect assumption that the macro language
is a number-crunching language, just like SAS.
It is a string-processing language.
No macro variable is a number,
even despite your natural-language parsing:
"has digits, decimals, no leading zeros, must be a number"
%LET ONE = 1;
%LET TWO = &ONE. + &ONE.;
%PUT TWO<&TWO.>;
TWO<1 + 1>
You want the macro processor to do integer arithmetic?
tell it:
%LET TWO = %eval(&ONE. + &ONE.);
%PUT TWO<&TWO.>;
TWO<2>
As I said in my presentation for the
Writing for Reading SAS Style Sheet:
" Know where you're at!
else Nowhere! You're at!"
Always check -your- assumptions
before asserting that the language shoulda told you so.
Ron Fehd the SQL into:macro maven CDC Atlanta GA USA RJF2@cdc.gov
remember perspective: the error is not always where it seems to occur! --
RJF2
|