|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: RE: Any suggestions for profile.do?
In a "more is sometimes too much" vein:
I use XP and often open datasets by double clicking the
icon. Sometimes I need to open several datasets, and I
thought the most efficient thing would be if "set mem"
in profile.do could match the size of the dataset. Hence,
my profile.do takes an argument and includes this to allocate
50% more memory than the file requires (unless Stata is
being invoked with .do file):
========================================================
set mem 100m
if "`1'"~="" {
if (strpos("`1'",".dta")>0) {
d using "`1'", short
local size = int(r(width)*r(N)*1.5/(2^20))
local size = max(10,`size')
set mem `size'm
use "`1'"
}
else if (indexnot("`1'",".do")>0) {
do "`1'"
}
}
=======================================================
(For reasons I don't understand, this does not work if
I replace "indexnot" from old versions with "strpos()==0".)
Of course, you then have to fiddle the command line for .dta
and .do file types so that profile.do is invoked with an argument,
so it's not for everyone.
Jeph
Nick Winter wrote:
In a "less is more" vein, I note that both -set mem- and -set matsize-
allow the -permanent- options, which removed the need to have them in
profile.do.
And you can specify a different starting directory on installation. Not
sure if that can be changed after installation...
Nick Winter
Nick Cox wrote:
On your last question, proper installation through -net- or -ssc-
(which is just an elaborate wrapper for -net-) takes care of that.
Conversely, I don't think there is anything you could put in a
profile.do that will stop you putting files in dopey places if you are
so minded (except -exit, STATA-).
I include this in my profile.do (local details suppressed)
set httpproxy on
set httpproxyhost <whatever> set httpproxyport 8080
and that's essential when it's essential. See help on -netio-.
There's software for which there's a deep art, or some kind of
chutzpah, in building up a long personalised initialisation file full
of clever tricks, but I am not sure that Stata is included under that
heading.
Nick
Allan Joseph Medwick
I just reinstalled Stata and I would like to keep my installation
directory clean. What are some good tips for making efficient use of
profile.do?
So far, I have included the following commands:
set mem 500m
set matsize 5000
cd C:\Users\amedwick\Documents\Stata
Is there a way to keep updates from STB, SJ, SSC in their own folders?
Anything else should I include?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/