Date: Thu, 18 Oct 2007 10:24:40 -0400
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject: Re: Is WHERE ALSO documented
Hari wrote:
> Hi,
>
> 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;
>Is WHERE ALSO documented?
Apparently not! Welcome to the nook-and-cranny club.
I have used it as long as I can remember (which means yesterday :). As Mike
stated, ALSO is clearly mentioned in WHERE function (SCL).
There is also the SAME-AND operator. My guess is that ALSO is an
undocumented alias of SAME AND. SAME-AND is documented in the WHERE
statement entry and was available in 6.12.
data Jo_1;
set sashelp.class;
where name contains 'J';
where also name contains 'o';
run;
data Jo_2;
set sashelp.class;
where name contains 'J';
where same and name contains 'o';
run;
The VIEWTABLE window also understands the WHERE ALSO command for extending
the active where clause. Viewtable wheres can be rolled back or reset with
WHERE UNDO and WHERE CLEAR (command interpretation gives precedence to
variable names when the table contains columns named "undo" or "clear")
WHERE UNDO and WHERE CLEAR are also valid statements in Procs that handle
run steps and need a quit; to end the proc.
proc gplot data=sashelp.class;
plot age*name;
run;
where name contains 'J';
run;
where same and name contains 'o';
run;
where same and name contains 'e';
run;
where undo;
run;
where clear;
run;
quit;
--
Richard A. DeVenezia
http://www.devenezia.com/