home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!gatech!paladin.american.edu!auvm!NPRDC.NAVY.MIL!ALDERTON
- Message-ID: <9209092041.AA17484@pacific.nprdc.navy.mil>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 9 Sep 1992 16:43:37 -0400
- Reply-To: alderton@nprdc.navy.mil
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: David Alderton <alderton@NPRDC.NAVY.MIL>
- Subject: numbers in SAS -- thanks
- Comments: To: SAS-L@uga.cc.uga.edu
- Lines: 30
-
- Earlier I asked how numbers were stored in SAS because I was trying
- to save space running SAS 5.18 under CMS. I was concerned about
- losing accuracy by defining numbers with too short a length.
-
- This came up because recently I read in a flat file that was about
- 34 Mb and created a SAS dataset that was nearly 4 times that large!
- The problem was that every variable was a number and was saved
- as 8 bytes. I recreated the dataset saving the numbers with length=2,
- since all were INTEGERS between 0 and 99. This reduced the size of the
- SAS dataset to under 10 Mb.
-
- Now I'm getting ready to read files that are (collectively) even larger
- and I certainly don't have enough space. My quandry was that many of
- the numbers in the new files are reals or integers larger than those
- I had dealt with previously and was afraid I would truncate them.
-
- Thanks to everyone for their help, especially Melvin Klassen and
- Peter Rikard who provided detailed explanations about representing
- numbers. But I have to admit, I'm still a little confused about how
- decimal values (like 999.786) are stored. As things turned out, I used
- length=2 for small integers, 3 for larger integers, 4 for proportions
- (i.e., proportion correct rounded to 3 decimal places in the source file),
- and used the default (8) for reaction times (measured to the millisecond,
- e.g., 10.297).
-
- I found no numeric differences between files read using length and those
- using the default lengths. I did however manage a 48% space savings.
-
- Thanks again,
- David (alderton@nprdc.navy.mil)
-