Date: Thu, 2 May 2002 11:07:47 -0400
Reply-To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject: Re: PROC COMPARE Options Questions
Content-Type: text/plain; charset="iso-8859-1"
> From: Myra Oltsik [mailto:myra@DATASQUARE.COM]
> I have a macro which has two proc compares in it. One compares the
> output of proc means between 2 versions, and the other compares the
> output of proc freq between 2 versions. My problem is I'm getting too
> much information in the list, and not enough information in the output
> file. I need help with the options in order to get the following:
Examine the options out*
proc COMPARE
base = &BASE.
compare = &COMPARE.
out = COMPARWS
outall /* == outBASE outCOMP outDIF outPERCENT */
outnoequal /* write only obs with one or more differences*/
noprint;
by &IDLIST.;
format _all_;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
> 1) ID variables which are in one file but not the other.
> 2) A list of ONLY the values that are different by the fuzz factor.
>
> In the second compare below, I run a data step after the proc to get
> only those records I need to look at. But since I also want a list of
> ID variables which are in one but not the other, I need the list. The
> list gives me EVERY comparison, even if the DIFF amount isn't printed.
> (In this compare, it is possible to have more than 32767 observations
> to compare, but only a few with a difference bigger than the fuzz
> factor. This prints out much more than I need.) What I'd like to have
> is the ID variables in the list, but the comparison differences in the
> output data set. Is that possible?
>
> Myra
>
> Here's the "meat" of the macro part:
>
> proc compare listobs maxprint=32767 fuzz=.01
> base=in3.&dsn3.readin
> comp=in4.&dsn4.readin
> out =&dsn4._in_means
> ;
> id var1;
> var percpop means mins maxs sums;
> run;
>
> proc compare listobs maxprint=32767 fuzz=1
> base=in3.sumfill_&dsn3
> comp=in4.sumfill_&dsn4
> out =&dsn3._in_values
> ;
> id var1 value;
> var percent;
> run;
>
> data &dsn3._in_values;
> set &dsn3._in_values;
> if abs(percent) lt 1 then delete;
> run;
>
|