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 (June 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 5 Jun 2000 11:56:53 EDT
Reply-To:     Bernard Tremblay <imaginasys@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bernard Tremblay <imaginasys@HOTMAIL.COM>
Subject:      Re: Strange Behaviour
Comments: To: subramaniam.baskaran@DB.COM
Content-Type: text/plain; charset=iso-8859-1; format=flowed

Baskar,

SAS use internally a floating point representation of your number. The precision depends of OS and the length of the field in bytes that you may have choosen.

I would say that you just have to print the number with the maximum precision allowed (must be something like "32.17" depending of your OS) to check what it is really. But I would say that checking if the rounding on a machine is working OK is a waste of time and you should rather go to the following link:

http://www.sns.ias.edu/Main/computing/compilers_html/common-tools/numerical_comp_guide/index.html

It will explain you what you should know about numerical calculation and computer. Precision cannot be infinite and one must deal with the issues ...

Regards,

\\\|/// \\ - - // ( @ @ ) +-----oOOo-(_)-oOOo--+-----------------------------------+ | Bernard Tremblay | | | CSST | Tel: (418) 528-9313 | | | Fax: (418) 528-1493 | | | Int: Bernard.Tremblay@csst.qc.ca | +----------------------------+---------------------------+ | Imaginasys enr | Res: (418) 658-1411 | | | Int: bertrem@quebectel.com | | | Hot: imaginasys@hotmail.com | +--------------Oooo--+-----------------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>From: Baskaran Subramaniam <subramaniam.baskaran@DB.COM> >Reply-To: subramaniam.baskaran@DB.COM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: Strange Behaviour >Date: Mon, 5 Jun 2000 19:44:18 +0530 > >Hello All > >Thanks for everybody who have responded and for sharing their knowledge. >The Round option on format did what I wanted. >This brings me to a question > >If the format used to view rounds off, then what is the real value and how >can I see it or I can write it to an external file..... Is the rounded off >value is valid? > >Am I missing out something , which is basic? > > >Thanks once again >Rgds >Baskar > > > > >---------------------------------------- Message History >---------------------------------------- > > >From: peter.crawford@db.com on 06/05/2000 01:46 PM GMT > >Please respond to peter.crawford@db.com > >To: SAS-L@listserv.uga.edu >cc: >Subject: Re: Strange Behaviour > > > >BAskar should try it with the ROUND option on the format. > >PROC FORMAT; > > PICTURE RSIGN(round) > > LOW-<0 = '999999999999.99-' > > 0-HIGH = '999999999999.99 ' > > ; > > > > >Datum: 05.06.2000 14:33 >An: SAS-L@listserv.uga.edu > > > > >Antwort an: imaginasys@hotmail.com > >Betreff: Re: Strange Behaviour >Nachrichtentext: > > >Hi BAskar, > > Simple. The PROC FORMAT does not round values and the format used when >you view the data does round ... If my memory is good you can't do nothing >with this but round yourself the figures before you write them to the file. > > Regards, > > \\\|/// > \\ - - // > ( @ @ ) >+-----oOOo-(_)-oOOo--+-----------------------------------+ >| Bernard Tremblay | | >| CSST | Tel: (418) 528-9313 | >| | Fax: (418) 528-1493 | >| | Int: Bernard.Tremblay@csst.qc.ca | >+----------------------------+---------------------------+ >| Imaginasys enr | Res: (418) 658-1411 | >| | Int: bertrem@quebectel.com | >| | Hot: imaginasys@hotmail.com | >+--------------Oooo--+-----------------------------------+ > oooO ( ) > ( ) ) / > \ ( (_/ > \_) >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > >From: Baskaran Subramaniam <subramaniam.baskaran@DB.COM> > >Reply-To: subramaniam.baskaran@DB.COM > >To: SAS-L@LISTSERV.UGA.EDU > >Subject: Strange Behaviour > >Date: Mon, 5 Jun 2000 17:15:15 +0530 > > > >Hello Listusers > > > > > >We have a library with some tables, these tables have some value fields > >with length as 8 and format as 15.2. > >After formatting these values, it has to be written into an external file >. > >For formatting, I am using the following proc > > > >PROC FORMAT; > > PICTURE RSIGN > > LOW-<0 = '999999999999.99-' > > 0-HIGH = '999999999999.99 ' > > ; > > > > > >After running the job, when I checked the output , I found a strange > >behaviour. Some of the > >values are decremented by .01 (compared to that displayed in the online > >SAS). > > > >This is not happening in all the fields but only happening in selective > >records and fields. > >I am unable to establish any pattern for this and also unable to >understand > >this behaviour also. > > > >Could somebody advise me on the possible reasons and the corrective > >measures. > > > >TIA > >Rgds > >Baskar > > > > >________________________________________________________________________ >Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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