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 (March 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 8 Mar 2002 16:50:24 +0100
Reply-To:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:   Re: Length statement and numeric precision
Comments:   To: Kevin Roland Viel <kviel@EMORY.EDU>
Content-Type:   text/plain

Kevin,

I have the same results in SAS v6.12 for Windows. But a length of 3 bytes here indicates a largest value of 2**(8*3)= 16777216. Are you sure your largest value would be 8192 (2**13), based on 14 bits, how many bytes is that in your system? Maybe SAS allows the statement LENGTH numvar 3 (for compatibility reasons); but SAS may find it difficult to actually store a 3-byte number and thus sneaky makes it 4 (or more) bytes, allowing all 4-byte values. Try an even larger value to see where it goes "wrong".

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statistician, P.O. Box 1 fax. +31 412 407 080 senior data manager 5350 AA BERGHEM IMRO TRAMARKO: a CRO J.Groeneveld@ITGroups.com the Netherlands in clinical research

My computer beeps when it complains; I complain when it beeps

Notice of confidentiality: this e-mail may contain confidential information intended for the addressed recipient only. If you have received this e-mail in error please delete this e-mail and please notify the sender so that proper delivery can be arranged.

> -----Original Message----- > From: Kevin Roland Viel [SMTP:kviel@EMORY.EDU] > Sent: Friday, March 08, 2002 3:58 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Length statement and numeric precision > > Greetings again, > > In three bytes, the largest integer that can exactly be represented on > IEEE system should be 8,191 (TS-654 states 8,192). The LENGTH statement > is supposed to "Specifies the number of bytes for storing variables". > Why am I able to see 10,000? > > 151 %put Version=&sysver OS=&SYSSCPL; > Version=8.2 OS=WIN_NT > 152 data _null_; > 153 length x 3; > 154 /* binary 01 1111 1111 1111 */ > 155 x=8191; > 156 put x=; > 157 /* binary 10 0000 0000 0000 */ > 158 x=8192; > 159 put x=; > 160 /* binary 10 0111 0001 0000 */ > 161 x=10000; > 162 put x=; > 163 run; > > x=8191 > x=8192 > x=10000 > NOTE: DATA statement used: > real time 0.01 seconds > cpu time 0.01 seconds > > > Regards, > > > Kevin > > Kevin Viel > Department of Epidemiology > Rollins School of Public Health > Emory University > Atlanta, Ga 30322


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