|
finch-post-10.mail.demon.net([194.217.242.38];helo=post.mail.demon.net) by
AKH-Wien.AC.AT with
TCP
Received: from [194.222.186.226] (helo=crawfordsoftware.demon.co.uk) by
post.mail.demon.net with smtp (Exim 2.10 #1) id 100iR2-0007du-00 for
SAS-L@AKH-WIEN.AC.AT; Thu, 14 Jan 1999 08:47:24 +0000
MIME-Version: 1.0
X-Mailer: Turnpike (32) Version 3.05 <uUq1LwAYB2QUgi8fmhIjRFrCnM>
Message-ID: <ZpquOHA17an2EwYl@crawfordsoftware.demon.co.uk>
Newsgroups: bit.listserv.sas-l
Date: Thu, 14 Jan 1999 08:46:45 +0000
Reply-To: Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@AKH-WIEN.AC.AT>
From: Peter Crawford <Peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Subject: Re: WHERE dataset option
X-LSVRepTo:
X-LSVopts: NOACK
X-LSVvia: SAS-L@AKH-WIEN.AC.AT
X-LSVTag: Message-ID: <ZpquOHA17an2EwYl@crawfordsoftware.demon.co.uk>
X-LSVTag: Date: Thu, 14 Jan 1999 08:46:45 +0000
X-LSVTag: To: SAS-L@AKH-WIEN.AC.AT
X-LSVTag: From: Peter Crawford <Peter@crawfordsoftware.demon.co.uk>
X-LSVTag: Subject: Re: WHERE dataset option
X-LSVTag: In-Reply-To: <916298687.204729.0@vm121.akh-wien.ac.at>
X-LSVTag: MIME-Version: 1.0
X-LSVTag: X-Mailer: Turnpike (32) Version 3.05 <uUq1LwAYB2QUgi8fmhIjRFrCnM>
To: $PEER$ <SAS-L@VTVM1.CC.VT.EDU>
In-Reply-To: <916298687.204729.0@vm121.akh-wien.ac.at>
In article <916298687.204729.0@vm121.akh-wien.ac.at>, Zdenek Seidl
<SeidlZ@TESCOSW.CZ> writes
>Hello,
>
>I have one simple (i think problem). I want to use dataset optin "where",
>but
>it didnt work as i expected. Consider the following example ...
>
>data work.a;
>input year month value;
>cards;
>1999 01 15
>1999 01 16
>1999 01 13
>1999 02 19
>1999 02 40
>1998 02 19
>1998 02 40
>1998 01 15
>1998 01 16
>;
>run;
>
>data work.a;
> set work.a(where=((month ne 01) and (year ne 1999)));
>
> ... some other statements ...
>
>run;
>
>I wanted to remove all observations from dataset a, where month AND year
>have certain values. But in this example above ALL observations for year
>1999
>will be deleted (observations with month=02 too)!!! It simply looks like
>this AND
>is interpreted like OR operator ...
>
>HOW does "where" option work? Whats wrong in this example?
>
>Of course, i can use proc sql instead to delete unwanted observations and
>then
>make other transformations, but i want to make some other operations in the
>same datastep to save time (in reality this data step "a" is quiet big (can
>be over 1GB).
>
>Please help me
>
> Thank you for any guesses
>
> Zdenek Seidl
it isn't the where clause, it is your use of logic
try where=( not ( month eq 1 and year eq 1999 ) )
--
Peter Crawford
|