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 (November 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 20 Nov 2009 11:06:05 -0800
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: Finding differences between records with same key in a big
              dataset (lots of fields)
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Split the data (or make views that split it) and use proc compare. Example:

data one two; set big; by key_field; if first.key_field then output one; else output two; run;

proc compare data=one compare=two; id key_field; run;

On Nov 20, 1:56 pm, Ajay <ajay.on....@gmail.com> wrote: > Hi, > > I am looking for some easy way to find differences between two records > having the same key. The dataset contains several hundred variables, > so i dont want to name the fields.. > > Data is something like the following... > > Key_Field Field_1 Field_2 Field_3 ............ > > Key1 a b c > Key1 a b not-c > Key2 x y z. > Key2 x not-y z... > ... > > in the above, i would like to come up with something like following > (basically for each key identifying fields that have mismatches).. > > Key1 and Field_3 > Key2 and Field_2 and so on.. > > Any inputs, would be highly appreciated! > > Thanks, > Ajay


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