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 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 15 Jun 2007 11:34:30 -0400
Reply-To:   Michael Raithel <michaelraithel@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Michael Raithel <michaelraithel@WESTAT.COM>
Subject:   Re: mistakes in SAS that don't generate errors
In-Reply-To:   <1181894449.459835.142190@c77g2000hse.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

Dear SAS-L-ers,

John Hendrickx posted the following:

> I'm looking for ways to produce unexpected results in SAS > that don't generate an error or warning message. Your syntax > is fine, it works as SAS intended but not as you intended. > Three examples: > > * Inadvertantly respecify a user-defined format. (This does > generate a note to the log that an existing format has been > overwritten but that's easy to overlook). > > * Using a "numbered range list" in a function, e.g. > "sum(x1-x5)". This will calculate the sum of x1 minus x5, > "sum(of x1-x5)" caculates the sum of x1 to x5. > > * Forgetting that missing values are represented by minus > infinity in comparisons. > > Are there other nice examples of SAS syntax that looks like > it does what you want it to at first glance or with > insufficient coffee? > John, as somebody else commented; this _IS_ an interesting thread. Contributions highlight the small, subtle, currents that can veer the SAS application boat steadily and subtly off course, so that it misses the island of correct results.

Though this is not what you are looking for, I'll bet that one of the biggest producers of unexpected results that "don't generate an error or warning message" and "works as SAS intended but not as you intended" is simple program coding mistakes. For instance, somebody coding:

gross_pay = pay_rate + hours_worked;

...instead of:

gross_pay = pay_rate * hours_worked;

Yea, it's easy to read when all alone, but try to find this puppy in a dog-pound of SAS code hundreds of lines long!

John, best of luck with staying away from subtle SAS mistakes that do not generate errors!

I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Michael A. Raithel "The man who wrote the book on performance" E-mail: MichaelRaithel@westat.com

Author: Tuning SAS Applications in the MVS Environment

Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=58172

Author: The Complete Guide to SAS Indexes http://www.sas.com/apps/pubscat/bookdetails.jsp?catid=1&pc=60409

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...and bad mistakes, I've made a few... - Queen, We are the Champions +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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