LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 22 Mar 2002 13:55:50 -0500
Reply-To:   "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject:   Re: Proc Sql and INTO macro variable Value
Content-Type:   text/plain; charset="ISO-8859-1"

> 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


Back to: Top of message | Previous page | Main SAS-L page