Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Do file refusing to open


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Do file refusing to open
Date   Thu, 18 Nov 2004 10:38:35 -0000

I agree with Daniel here. I believe that the only way 
to change the 32000 bytes limit is to clone Stata
and to change that setting in your own version 
of the C code. 

More practically, 

0. Stata's do editor is a very useful little editor
and has the important advantage of integration 
with Stata, but no-one claims more than that. 
I am often flabbergasted at how people manage
to do serious analysis without the aid of a 
full-blown text editor (which doesn't mean 
a word processor). The FAQ Daniel cites 
is itself a full-blown statement of this view 
by some dozens of Stata users. 

1. Splitting do files hierarchically is good 
strategy, as you are aware and as Daniel emphasises. 

2. Your do file could be very long because 

(a) your analysis is very complicated; 

(b) your code is unnecessarily repetitive; 

or both. 

Naturally we can't tell which is right, but I've seen 
do files in which something was repeated for 
dozens of variables or dozens of special cases, 
and the code could have been drastically condensed. 

A questioner on Statalist some time ago 
wrote of a do file containing 500 commands, two for each of 
250 item codes. It appeared that their question could be 
largely solved by just two -egen- commands, in which
-by:- was used to iterate across different codes. 

A brisk introductory tutorial on ways of doing repetitive 
analyses easily was offered in 

How to repeat yourself without going mad. 
Stata Journal 1(1): 86--97 (2001)

Nick 
[email protected] 

Daniel Egan
 
> I would suggest reading up on text editors (other than notepad) at
> http://fmwww.bc.edu/repec/bocode/t/textEditors.html.  I do not know
> that you can increase the memory of the text editor.
> 
> My trick:
> I keep one do file in the do file editor, which references the files I
> have in my text editor. That way you don't mess around with the
> master, but can change the subfiles at will.
> 
>  I personally use crimson editor. It has one screen, on the top of
> which there are tabs. Each of these tabs represents a file, thus I
> have
> 
> [master.do] [sub1.do][sub2.do][subN.do]
> 
> where master.do says "do sub1, do sub2" etc. Its extremely easy to
> keep on top of files that way. Crimson also has syntax highlighting
> which is useful, as well as the other nifty text editing tricks that
> the stata editor does not.
> 
> If you are even more ambitious, you can read up on invoking stata from
> the text editor, a trick I have heard of but never tried.

Tewodaj 

> . Sometimes when I try to open a do
> > file I get the message:
> > "Could not open file because it is larger than 32000 
> bites". Of course
> > I can always open it as an ASCII e.g. in Notepad, then edit it as
> > needed, then run it by typing do c:\...\myfile.do but that is rather
> > tedious if I am interacting frequently between running and 
> editing. Any
> > ideas how I can increase the "memory" of the do file opener? I have
> > broken the file down into smaller do files but I can't keep 
> doing that
> > as it becomes hard to overview the programme.

*
*   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/



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