Date: Fri, 8 Aug 2008 16:12:05 -0700
Reply-To: Adriano Rodrigues <adriano@GPP.COM.BR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Adriano Rodrigues <adriano@GPP.COM.BR>
Subject: RES: numeric fields, where is the diference
In-Reply-To: <048d01c8f986$390f0a40$832fa8c0@HP82083701405>
Content-Type: text/plain; charset="us-ascii"
Yes, I know proc compare. But I think don't works for what I want. Thanks
anyway.
Adriano
-----Mensagem original-----
De: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] Em nome de Mary
Enviada em: sexta-feira, 8 de agosto de 2008 11:40
Para: SAS-L@LISTSERV.UGA.EDU
Assunto: Re: numeric fields, where is the diference
Adriano,
Do you know about Proc Compare? You could subset your master to only those
observations in your received set, then run proc compare on them to tell you
the specific differences:
ods trace on;
ods select CompareDifferences;
ods output CompareDifferences=CompareDifferences_set;
proc compare base=set1
compare=set2 NOMISSBASE NOMISSCOMP;
by id;
run;
-Mary
----- Original Message -----
From: Adriano Rodrigues
To: SAS-L@LISTSERV.UGA.EDU
Sent: Friday, August 08, 2008 5:38 PM
Subject: numeric fields, where is the diference
Hi all,
I have 2 databases, one master with all Ids and one variable to show me some
information, and one new data, who is from another source. I want check if
variable find=base for same id.
All this is ok with this code:
data a;*master data;
input id base;
datalines;
1 2
2 2
3 4
4 5
5 1932
6 21
;
run;
data b;*received data;
input id find;
datalines;
1 2
3 4
4 5
5 2932
6 21
;
run;
proc sort data=a;
by id;
run;
proc sort data=b;
by id;
run;
data combine;
merge a b (IN=INB);
by id;
IF INB;
RUN;
data enderror;
set combine;
error=base-find;
proc print;
var id base find error;
where error^=0;
run;
output:
Obs id base find error
4 5 1932 2932 -1000
Desired output would be bold error, or other font for the where is error,
the 2 could be italic? (from 2932) I need this because my real data have
numbers with 8-9 digits to 13-14 digits. Here I see fast the error is 2 to 1
to change, but when many numbers this come more hard to find.
Well, if anyone has one suggestion to improve this, I am here to learn, many
thanks.
Observation: this data come from other sources where I cant actually
automatic make any correction, who send have to correct manually and send
back to me and I will send report where are the errors
Adriano