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 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 11 Mar 2004 13:35:15 -0500
Reply-To:     "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV>
Subject:      Re: Numeric Questions?
Comments: cc: "Ross, Michael D" <michael.ross@ASTRAZENECA.COM>
Content-Type: text/plain; charset="us-ascii"

> From: Ross, Michael D [mailto:michael.ross@ASTRAZENECA.COM] > What is the maximum length a Numeric 8. can hold? I noticed > with very large numbers they use scientific notation - is > there any way to see actual value.

Char = put(N,hex16.);

> Maybe an algoritim that > reads the Numeric into a very large Character field.

Char = put(N,binary64.);

> Also, is there any harm in allocating Numeric 8. when you > know your only going to have 2 digits in that variable?

depending on your OpSys you may save storage of small integers in either two or three bytes length SmallInteger 2; length SmallInteger 3;

if this is a number you're stuck otherwise, if it is a category, use length SmallInteger $ 1; and consider extendedHex to store numbers up to 36 value $ExtendedHex '0'= 0 '1'=1 '2'=2 ... '9'=9 'A'=10 ... 'F'=15' 'G'=16 ... 'Z'=36 other = 'off the scale';

DATA _Null_; Do Exp = 30 to 256; MaxInt = 2**Exp-1; put Exp= MaxInt=comma32. MaxInt= hex16. / MaxInt= binary64. ; end; stop;run;

you'll see the notation give up commas and then go to scientific notation at varying exponents.

Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov

My computer must be broken: whenever I ask a wrong question, I get a wrong answer. -- Pot-Shots by Ashleigh Brilliant

My computer is not over-stressed yet: let me add one to the exponent and see if I get overflow. -- RJF2


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