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 (October 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 5 Oct 2011 17:32:57 -0400
Reply-To:   Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Quentin McMullen <qmcmullen.sas@GMAIL.COM>
Subject:   PROC COMPARE output dataset
Content-Type:   text/plain; charset=ISO-8859-1

Hi All,

Was wondering if anyone had a favorite macro that would output proc compare results to a dataset in a nice format?

I love PROC COMPARE. But I hate the output datasets it gives (at least as far as I have looked, certainly may be missing something). I hate the dataset output so much, I've never taken the time to build what I would want as an output dataset from PROC CONTENTS. So was wondering if I'm missing something obvious, or if someone else has built it already.

What I (think) I want is a tool (probably macro, but I'm happy to write the macro part) where I could compare two datasets, and output a dataset with the results of the comparisons on every *value*. (I'm not worried about dataset attributes or variable attributes, just comparison of values).

So I imagine a structure something like:

id variable base_value compare_value

I suppose to accomodate numeric and character vars I might end up with :

id variable base_value_n compare_value_n base_value_c compare_value_c

If a record (id) was found in one dataset but not the other, I would want to assign the value to be a special missing code.

I suppose since there can be multiple ID vars, I would need to have multiple ID vars in the output dataset (or one character variable that held all of the ID values).

I could be off track here. So certainly open to hearing thoughts from others before I delve into this.

As much as I love proc compare now for SHOWING me what the differences are between two datasets, I haven't managed to have it give me this information in a usefully organized dataset. So when I want a dataset, I often resort to merging two datasets, renaming the variables in one version, then comparing the values myself in a datastep. Which works, but I'm sure there's a better way.

Kind Regards, --Quentin


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