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 (March 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 30 Mar 2007 13:38:19 -0400
Reply-To:     Ed Heaton <EdHeaton@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ed Heaton <EdHeaton@WESTAT.COM>
Subject:      Re: select statement in data step
Comments: To: Jean-Jacques Dubois <jjbdubois@MINDSPRING.COM>,
          Harry Droogendyk <harry.droogendyk@RBC.COM>
In-Reply-To:  <200703281652.l2SAkwX6011383@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

I, for one, don't like the ELSE IF construct. So, I generally use the select statement if presented with more than two branches. It just seems easier to grasp when looking at code and at least as easy to code. Furthermore, the OTHERWISE statement reminds me to consider things that don't follow one of the branches.

Ed

Edward Heaton, Senior Systems Analyst, Westat (An Employee-Owned Research Corporation), 1650 Research Boulevard, RW-4541, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 294-3879 mailto:EdHeaton@Westat.com http://www.Westat.com

-----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Jean-Jacques Dubois Sent: Wednesday, March 28, 2007 12:52 PM To: SAS-L@LISTSERV.UGA.EDU; Harry Droogendyk Subject: Re: select statement in data step

Harry, woops! I should have taken a look at sashelp.class first. Whenever I have used 'select', it is to create a new variable, and with an explicitly defined value of that variable corresponding to every combination of the other variables. Hence, I have not needed the trailing 'otherwise'.

I, for one, have run into situations where 'select' is somewhat less confusing than piling on the 'if-thens', and possibly more economical, but it is often a wash, and not worth it when one or two 'if-thens' would do the job.


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