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: Compress a closed file

From   "Michael N. Mitchell" <>
Subject   Re: st: Compress a closed file
Date   Tue, 22 Feb 2011 01:49:44 -0800


I do not know how to compress a file that is too large to fit into memory. But, you could read portions of the file into memory, compress the portions, and then reassemble the portions. This assumes that the -compress- command will yield enough memory savings.

  You can read a portion of the file either by reading a subset of variables, e.g.

. use var1 var2 var3 using myfile.dta

  or you can read a subset of observations, e.g.

. use if gender==1 using myfile.dta


. use in 1/5000 using myfile.dta

  You can use the describe command to learn the variable names of the file, for example...

. describe using myfile.dta

It is possible that you might be able to read in just the variables and/or observations you are interested in using these techniques.

  I hope this helps,

Best luck,

Michael N. Mitchell
Data Management Using Stata      -
A Visual Guide to Stata Graphics -
Stata tidbit of the week         -

On 2011-02-22 1.42 AM, Mohamad Al Ississ wrote:
The file I'm trying to open a file that's too large for my Stata's memory (I
maxes the memory setting). I get the "no room to add more observations..."
error. I know that if I compress the file, it'll solve the problem. Is there
a way to compress the file w/o opening it?

Mohamad Al-Ississ, Ph.D.
Assistant Professor of Economics
School of Business
The American University in Cairo
*   For searches and help try:
*   For searches and help try:

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