Date: Mon, 21 Mar 2005 09:44:56 -0800
Reply-To: Dennis Diskin <diskin@SNET.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dennis Diskin <diskin@SNET.NET>
Subject: Re: PROC compare-finding true differences
In-Reply-To: 6667
Content-Type: text/plain; charset=us-ascii
Tracy,
Try adding the statement:
ID KEY;
HTH,
Dennis Diskin
--- Tracy Haidar <thaida1@UMBC.EDU> wrote:
> I am trying to use proc compare to find differences
> in data sets. Example:
>
> Data set A
> Key Name Value
> 1 abc 123
> 2 def 456
> 3 ghi 789
> 4 jkl 012
>
> Data set B
> Key Name Value
> 2 def 456
> 3 ghi 98765
> 4 jkl 012
> 5 mno 234
>
> I have sorted both data sets by key. When I use proc
> compare
>
> proc compare base= DS_A compare= DS_B LISTCOMPOBS
> LISTBASEOBS ;
> run;
>
> It gives me (1) a list of obervations in A but not B
> and vice-versa, which
> I want, but also (2) prints out a whole bunch of
> differences that are just
> an artifact of obs 1 in data set A not matching obs
> 1 in data set B.
>
> Which options should I use so that the only
> differences it prints in (2)
> are true differences (i.e., in this case, the value
> associated with key=3)?
>
> Thanks in advance
>
|