LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: RODNEY PRESLEY <WAPRO.RPRESLEY@SDPS.ORG>
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 ----------------------------------------------------------------


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