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 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 18 Oct 2007 10:17:15 -0400
Reply-To:     Don Henderson <donaldjhenderson@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:     RFC822 error: <W> MESSAGE-ID field duplicated. Last occurrence
              was retained.
From:         Don Henderson <donaldjhenderson@HOTMAIL.COM>
Subject:      Re: Is WHERE ALSO documented
Comments: To: Nathaniel.Wooding@DOM.COM
In-Reply-To:  <OF98BC8768.F9885E16-ON85257378.0048C47C-85257378.004AECC2@dom.com>
Content-Type: text/plain; charset="US-ASCII"

Excellent point Nat about writing a string of statements. That is how I have typically used WHERE ALSO - in web apps where the user can enter one or more where conditions.

Note that the ALSO operator seems to work even on the "first" WHERE clause. Thus eliminating the need to determine whether to put ALSO there. Consider the following:

8 proc print data=sashelp.class; 9 where also sex = 'M'; NOTE: Where clause has been augmented. 10 where also age gt 12; NOTE: Where clause has been augmented. 11 run;

NOTE: There were 6 observations read from the data set SASHELP.CLASS. WHERE (sex='M') and (age>12); NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds

The above was run using 9.1.3. I will try it out in V8 shortly and post a followup.

Regards, -don h

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On > Behalf Of Nat Wooding > Sent: Thursday, October 18, 2007 9:38 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Is WHERE ALSO documented > > Miiiikkkkkkkeeeeeeee > > My paper V6 manual does not include Also as part of where > processing. In addition to Don's reference, think back to SGF > 1 last spring. When you were slurping down the triple > whatever lattes in Starbucks, you should have been listening > to Sunil Gupta (Paper 213-2007) discuss where vs if statements. > > http://www2.sas.com/proceedings/forum2007/213-2007.pdf > > > It appears that the Also modifer (my term) allows one to > wright a series of where statements without having to string > them all together in one mass of boolean spaghetti. > > Nat > > Nat Wooding > Environmental Specialist III > Dominion, Environmental Biology > 4111 Castlewood Rd > Richmond, VA 23234 > Phone:804-271-5313, Fax: 804-271-2977 > > > > Michael Raithel > <michaelraithel@W > ESTAT.COM> > To > Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU > Discussion" > cc > <SAS-L@LISTSERV.U > GA.EDU> > Subject > Re: Is WHERE ALSO documented > > 10/18/2007 08:47 > AM > > > Please respond to > Michael Raithel > <michaelraithel@W > ESTAT.COM> > > > > > > > Dear SAS-L-ers, > > Hari posted the following interesting question: > > > I came across usage of the WHERE ALSO in online learning. > > > > I understand now that it performs same as "WHERE SAME AND > ..." but not > > able to see the same documented in help? I checked up through the > > Where statement portion in SAS Language Reference: Dictionary. > > > > %macro attend(crs,start=01jan2001,stop=31dec2001); > > %let start=%upcase(&start); > > %let stop=%upcase(&stop); > > proc freq data=sasuser.all; > > where begin_date between "&start"d and "&stop"d; > > table location / nocum; > > title "Enrollment from &start to &stop"; > > %if &crs= %then %do; > > title2 "for all Courses"; > > %end; > > %else %do; > > title2 "for Course &crs only"; > > where also course_code="&crs"; > > %end; > > run; > > %mend; > > > Hari, very interesting. No, make that VERY INTERESTING! > That construct looks familiar, but I cannot put my finger on > where I have seen/used it before. It reminds me of SCL-type > code that I used in the dim and distant past in SAS/AF applications. > > I see that there is something like this in the SAS Online > Documentation, in the SAME-AND operator for the WHERE statement: > > > http://support.sas.com/onlinedoc/912/getDoc/lrcon.hlp/a000999255.htm > > ...(when you get to this link do a search for SAME-AND), but > I do not see a WHERE ALSO, anywhere. I wonder if this is a > relic from a previous version of SAS???? > > So, a BIG ATTABOY (or ATTAGIRL) and a BIG cup of Starbuck's > coffee to the SAS-L-er who can put his/her finger on the > illusive "WHERE ALSO" > operator! > > Hari, I'll look forward to seeing what our SAS-L colleagues > come up with on the interesting question you raised! > > > 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 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > The palest ink is better than the best memory. - Chinese proverb > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > > ----------------------------------------- > CONFIDENTIALITY NOTICE: This electronic message contains > information which may be legally confidential and/or > privileged and does not in any case represent a firm ENERGY > COMMODITY bid or offer relating thereto which binds the > sender without an additional express written confirmation to > that effect. The information is intended solely for the > individual or entity named above and access by anyone else is > unauthorized. If you are not the intended recipient, any > disclosure, copying, distribution, or use of the contents of > this information is prohibited and may be unlawful. If you > have received this electronic transmission in error, please > reply immediately to the sender that you have received the > message in error, and delete it. Thank you. >


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