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 (June 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 25 Jun 1999 17:15:59 -0400
Reply-To:     GORRELP1 <GORRELP1@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         GORRELP1 <GORRELP1@WESTAT.COM>
Subject:      Re: SOLVED: Omitting "OF" with SUM function
Comments: To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Content-Type: text/plain; charset=US-ASCII

We all want SAS to be as user friendly as possible. But we don't want the LOG cluttered with 'just in case' WARNINGS. If you submit a syntactically-valid statement for execution, it's expecting a bit much for SAS to 'know what you meant' or to warn you that you might not have submitted what you meant (it's also a mean parsing problem to compute the alternatives). It's often all too easy to get in trouble, just type "IF X = Y" instead of "IF X ^= Y".

Paul Gorrell gorrelp1@westat.com

____________________Reply Separator____________________ Subject: Re: SOLVED: Omitting "OF" with SUM function Author: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM> Date: 06/25/1999 2:12 PM

Yes, but I'm not sure what else SAS should do. Should it give an error message if you have two minus signs in a row without intervening parentheses? That wouldn't match standard mathematical notation (which the data step language usually does, being based on PL/I syntax).

-- JackHamilton@FirstHealth.com Development Manager, METRICS First Health, West Sacramento, California USA

>>> Tom Frenkel <taf2@IS8.NYU.EDU> 25Jun1999 11:58 AM >>> To SAS-L:

With Ian Whitlock's help, I now understand why I didn't get an error message. SAS interprets

sum(x--y)

as

sum(x-(-y))

i.e.

sum(x+y)

In other words, the sum of x and y.

With hindsight, this seems very clear. However, I *still* think it's too easy for someone to get into trouble, if they mean to write "sum(of x--y)" but instead write "sum(x--y)" !

--Tom

Tom Frenkel Assoc. Research Scientist Center for Health & Public Service Research New York University taf2@is8.nyu.edu


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