Date: Mon, 7 Jan 2002 12:34:00 +0100
Reply-To: Peter Crawford <peter.crawford@DB.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@DB.COM>
Subject: Re: problem with comparing digits
Content-type: text/plain; charset=iso-8859-1
I've been watching with interest
On os390 and ibm-aix sas v8.1, I'm getting TrueFalse=1
However on winNT sas v8.1 TrueFalse=0
So I checked just a little further.
( I can't find any earlier reference to this)
Rounding to non-integer, produces TrueFalse=0
Rounding to the integer, produces "equality" 1
as in this small extension of the test case
55 data _null_;
56 A = '406C04395810624E' ;
57 B = '406C04395810624D' ;
58 An = Input(A, Hex16.) ;
59 Bn = Input(B, Hex16.) ;
60 Ar = Round(An, .001) ;
61 Br = Round(Bn, .001) ;
62 Bi = Round(1000*Bn, 1) ;
63 Ai = Round(1000*An, 1) ;
64 Put An= An=Hex16. Ar=Hex16.;
65 Put Bn= Bn=Hex16. Br=Hex16.;
66 TrueFalse = Ar Eq Br;
67 Put TrueFalse=;
68 Put ai= ai=Hex16. ;
69 Put Bi= Bi=Hex16.;
70 TrueFalsI = Ai Eq Bi;
71 Put TrueFalsI=;
72 run;
An=224.132 An=406C04395810624E Ar=406C04395810624E
Bn=224.132 Bn=406C04395810624D Br=406C04395810624D
TrueFalse=0
Ai=224132 Ai=410B5C2000000000
Bi=224132 Bi=410B5C2000000000
TrueFalsI=1
NOTE: DATA statement used:
Regards
Peter Crawford
Datum: 07/01/2002 10:38
An: SAS-L@LISTSERV.UGA.EDU
Antwort an: "Vyverman, Koen" <koen.vyverman@FID-INTL.COM>
Betreff: Re: problem with comparing digits
Nachrichtentext:
Allow me to chime in and add another dissonant chord to the
cacophony ...
26 data _Null_ ;
27 A = '406C04395810624E' ;
28 An = Input(A, Hex16.) ;
29 Ar = Round(An, .001) ;
30 Put An= An=Hex16. Ar=Hex16.;
31 B = '406C04395810624D' ;
32 Bn = Input(B, Hex16.) ;
33 Br = Round(Bn, .001) ;
34 Put Bn= Bn=Hex16. Br=Hex16.;
35 TrueFalse = Ar Eq Br;
36 Put TrueFalse=;
37 run;
An=224.132 An=406C04395810624E Ar=406C04395810624E
Bn=224.132 Bn=406C04395810624D Br=406C04395810624E
TrueFalse=1
System: WinNT4.0 SP6 Build 1381
SAS: 8.2 (TS2M0), all relevant hotfixes applied.
Processor: x86 Family 6 Model 8 Stepping 3 GenuineIntel
Cheers,
Koen V.
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.