Statalist


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

Re: st: clear and clear all


From   Stas Kolenikov <[email protected]>
To   [email protected]
Subject   Re: st: clear and clear all
Date   Sun, 2 Aug 2009 07:56:36 -0500

So why exactly do you want to -use- a data set, and then -clear- it
away without doing anything to the data?

What might be really cool is to have something along the lines of

use varfile, clear overhead(30) min(10m)

so that behind the curtain Stata would:
1. -clear all-
2. look at the size of varfile on disk
3. -set mem max( (100+overhead)% of the file size, 10m )-
4. -use varfile-

The second step is actually quite complicated. -dir- aka -ls- do not
return anything Stata could understand; the -file- suite in either
Stata or Mata does not have that functionality, either; undocumented
-st_freadsignature()- in Mata cannot really look up the size of the
data file yet as the header it describes has not yet been implemented
for dta files. A working solution is to -describe using varfile- from
which you can figure out the size of the data matrix -r(width)*r(N)-
in bytes. There's still the header of the file with labels, chars and
such that takes some space, too, but the total size of the file is not
returned by -describe-.

On Sun, Aug 2, 2009 at 4:52 AM, Fred Wolfe<[email protected]> wrote:
> A minor suggestion for Stata 11.
>
> As Stata 11 requires -clear all- before -set mem-, breaking many older
> do files for me, I tried this sequence:
>
> . use varfile,clear all
> option all not allowed
> r(198);
>
> . use varfile,clear
> . clear all
> . set mem 1000m
>
> If -clear- is an option to -use-, perhaps Statacorp could also make
> -clear all- an option to use.
>
> Fred
>
>
> --
> Fred Wolfe
> National Data Bank for Rheumatic Diseases
> Wichita, Kansas
> NDB Office  +1 316 263 2125 Ext 0
> Research Office +1 316 686 9195
> [email protected]
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>



-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index