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?
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