Using DBMS/Copy to Shrink Variable Sizes
Sometimes a data file will be too large to use in the program to which you want
to convert. This is often the case when you want to use a large file in Stata on
a PC. You can use DBMS/Copy to shrink the size of the file by using the
"Variable Information" button in the Power Panel.
Two very effective ways of making the file smaller is to shrink the variable
sizes as well as dropping variables you do not need. Shrinking the sizes changes
how the computer stores the
information in the variable. "Double" means that the computer is using as much
space as it can to store the information. If the variable only takes on a few
values (like 1 or 0), then this is a big waste of space. Dropping variables you
do not need will also help make the file smaller. Be careful though: if you are
not sure if you need a variable or not, then keep it. It is easier to drop it
later than it is to have to go back and get it.
- When the Power Panel window pops up, click the "Variable Information" button.
- Check the variables you want to drop (or keep if you want to drop more than
you keep). When you are done, click on the "Shrink Sizes" button. This
operation may take a few minutes depending on how large the file is.
- When the process is done, you will see the changes that were made to how the
variables are stored. The actual dropping or keeping will be done when the file
is actually converted. In this example, the file that was converted went from an original size of 32
megabytes to less than 1 megabyte!