Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Store datafile at minimum possible file size

From   "Nick Cox" <>
To   <>
Subject   RE: st: Store datafile at minimum possible file size
Date   Fri, 16 Apr 2010 12:28:51 +0100

Note that Stata 11 has an embedded -zipfile- command. 


-----Original Message-----
[] On Behalf Of Abdel Rahmen
El Lahga
Sent: 16 April 2010 12:16
Subject: Re: st: Store datafile at minimum possible file size

In my experience the best solution is to zip immediatlt the stata file
without using ascci format. If we try
set mem 2g
set obs 10000000
gen str12 var1 ="abcdefghijkl"
gen str14 var2 ="abcdefghijklmn"
gen var3 =rnormal()
gen var4 =runiform()
qui save data_boehm , replace
outfile using "ascii_boehm.raw", replace
-rw-r--r--    1 abdelrahmenlahga  staff  550000000 Apr 16 12:05
-rw-r--r--    1 abdelrahmenlahga  staff  340000912 Apr 16 12:00
As you can see the ascii file is much bigger than the Stata one.
you can zip it to reduce the file zize to about 85m

2010/4/16 Michael Boehm <>:
> Dear statalisters,
> I have a big datafile (2 string variables, 2 numeric one, 10million
> observations) created in Stata and want to save it in the smallest
> version possible. I have tried out the "outfile" command to write it
> as an ASCII, but as far as I understand this doesn't give me the
> smallest ASCII file possible. Can anyone help?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index