Date: Thu, 5 Aug 1999 16:55:42 -0400
Reply-To: laurie_abell@DOFASCO.CA
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Laurie Abell <laurie_abell@DOFASCO.CA>
Subject: Re: how does SAS stores stuff? v6.12 NT
Content-Type: text/plain
Hi Harry,
SAS 6.12 uses the entire length of character variables and (by default)
8bytes for the numerics. From what I know, every observation has the same
length - which is why it's so easy to estimate the size of a SAS dataset :
{(record length * #obs) + a bit of overhead}.
There is no space saving for null character variables or character variables
that do not use all of the bytes (if "defined" as $40 it will always use 40
bytes). There is none for numerics either, unless you specify the length of
numeric variables (can be between 3 and 8).
Even though you have a numeric either input using 14.2 or formatted as 14.2,
I believe that its stored length is 8 bytes (you can check proc contents for
sure). And there are limits to what can be stored in a shorter numeric
variable (this is somewhere in the language guide and I think it has to do
with the total number of digits and the precision).
I'm not sure what to suggest to save space in your 670MB file. I don't
usually like to mess around with the lengths of numeric variables, so the
only alternative is to shorten some of the character variables if it's
possible.
hope this helps!
Laurie
~~~~~~~~~~~~~~~~~~~~~~
> Laurie Abell
> Dofasco Inc., I.S. Data Services
> laurie_abell@dofasco.ca
>
>
>
> -----Original Message-----
> From: Droogendyk, Harry [SMTP:Harry_Droogendyk@NEWCOURT.COM]
> Sent: Thursday, August 05, 1999 4:28 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: how does SAS stores stuff? v6.12 NT
>
> Learned listers:
>
> I have a question relating to how SAS stores both character and numeric
> data
> in version 6.12 on an NT. We are getting a little concerned about a SAS
> dataset that's grown to 670 meg.
>
> If I define a field as $40 and the field is empty ( or contains all blanks
> )
> for a given observation, what does SAS store? How many bytes are gobbled
> up
> by this field?
>
> Same deal for zero or missing numeric values. How many bytes are consumed
> for a zero value in a field that is defined as 14.2?
>
> TIA,
> Harry
|