Date: Tue, 3 Jul 2007 08:44:20 -0700
Reply-To: barry.debenham@TALK21.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: barry.debenham@TALK21.COM
Organization: http://groups.google.com
Subject: Re: More proc compare problems
In-Reply-To: <E2B5EBDD92CF104E9AC69D6B563466C903EA78@EDUNIVMAIL11.ad.umassmed.edu>
Content-Type: text/plain; charset="us-ascii"
On 3 Jul, 15:29, Lorna.Si...@UMASSMED.EDU ("Simon, Lorna") wrote:
> I followed Matt's suggestion, but now it's outputting all observations,
> instead of just the ones that don't match. Is there any way to get it to
> just output the non-matches. Here is my code:
>
> %let id=3D%str(id); /*Insert name of id variable(s) here*/
> %let library=3Dtemp;/*Insert name of library here*/
> %let data1=3Ddlpage3; /*Insert name of 1st data file here*/
> %let data2=3Djgpage3; /*Insert name of 2nd data file here*/
> %let varlist=3D%str(fmps_c--fm16_2m fmsd_3--fmmed_e);
> %let dataout=3Dresult/*insert output data set name here*/;
> /*proc contents data=3D&library..&data1 position; run;*/
>
> proc sort data=3D&library..&data1; by &id; run;
> proc sort data=3D&library..&data2; by &id; run;
>
> PROC COMPARE base=3D&library..&data1 compare=3D&library..&data2
> MAXPRINT=3D(32767, 32767)
> /*stats*/ noprint out=3D&library..&dataout
> out=3Dresult outnoequal
> outdif;
> id &id;
> *var &varlist;
> RUN;
>
> proc print data=3D&library..&dataout;
> run;
>
> Use the NOPRINT option of the PROC COMPARE statement as well as the =
> OUT=3D
> option to write the data to an output SAS data set that you can then
> print with a PROC PRINT paragraph (cf., the PROC COMPARE documentation
> example that uses an OUT=3D data set).=20
> Moreover, use the OUTNOEQUAL, OUTBASE, OUTCOMP, and OUTDIF options.
>
> Matthew Zack
>
>
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:S...@LISTSERV.UGA.EDU] On Behalf Of
>
> Simon, Lorna
> Sent: Monday, July 02, 2007 10:40 AM
> To: S...@LISTSERV.UGA.EDU
> Subject: Proc compare truncating string variables
>
> Hi all. A colleague of mine is having a problem w/ proc compare. It's
> truncating some of her longer string variables in the output. Is there
> any way around this? I've checked help and could find nothing that
> addressed this. Thanks.- Hide quoted text -
>
> - Show quoted text -
Lorna,
You just need to use the OUTNOEQUAL option on the PROC COMPARE
statement.
Regards,
Barry D.
|