Date: Thu, 7 Oct 1999 03:01:32 +0100
Reply-To: John Whittington <John.W@MEDISCIENCE.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: John Whittington <John.W@MEDISCIENCE.CO.UK>
Subject: Re: Use of SUM function in data step WHERE clause -- Answered
In-Reply-To: <199910011629.RAA06206@vicar.netnames.net>
Content-Type: text/plain; charset="us-ascii"
At 12:31 01/10/99 -0400, RODNEY PRESLEY wrote:
>Thanks to John Whittington, Pete
>Lund, Peter Crawford, and a little birdie
>for answering this question.
>
>Since the WHERE clause or statement
>is limited by actions that can be
>supported in SQL (hence variable lists
>not supported) are there other "got
>ya's" that one, like myself, who is less
>familiar with SQL should be on guard
>for?
Rodney, yes, I'm sure there are many. One that the little birdie pointed
out to me at the time was that implicit character-to-numeric conversions
will not be undertaken in WHERE clasues. For example, if char is a
character variable containing 'numeric' values ('0', '1', '2' etc.) then
the code:
IF char ;
will perform a character-to-numeric conversion, and the IF condition will
be regarded as 'true' if the converted numeric value is greater than zero,
but 'false' if that converted value is zero. However, if one codes:
WHERE char ;
.. then no such type conversion takes place, and any non-BLANK value of the
character variable char (including '0') will represent a 'true' condition.
That one only really applies to those lazy people (like me!) who sometimes
let implict type conversions happen - but I'd be surprised if there are not
some otehr pitfalls even for those who do not have such 'bad habits'!!
Regards,
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
Buckingham MK18 4EL, UK mediscience@compuserve.com
----------------------------------------------------------------
|