Date: Tue, 11 May 2004 08:49:17 -0400
Reply-To: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Subject: Re: Comparing datasets
Others have given you working solutions. In your case, going strictly by
the way you have defined your problem, the following could also work.
data a b ;
do x = 1 to 10 ;
if mod (x,2) = 1 then output b ;
output a ;
end ;
run ;
data c ;
set a b ;
by x ;
if first.x and last.x ;
run ;
You have mentioned that B is a subset of A, so it follows that any
duplicate in C comes from B. So the above should work for you as well.
Venky Chakravarthy
On Tue, 11 May 2004 00:48:27 +0000, Laughing Beggar
<laughing_beggar@HOTMAIL.COM> wrote:
>Hi all,
>This is probably dead easy, and I'm almost embarrassed to ask ...
>I have 2 datasets, each has one variable and Dataset 'B" is a subset of
>Dataset 'A'. How do I create a new dataset containing the values in 'A'
that
>are not in 'B' ?
>I had a go with PROC COMPARE but.....
>Cheers
>Laughing_Beggar
>
>"The beggar laughs in the face of the thief"
>
>_________________________________________________________________
>Get Extra Storage in 10MB, 25MB, 50MB and 100MB options now! Go to
>http://join.msn.com/?pgmarket=en-au&page=hotmail/es2
|