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

st: RE: Re: error code with tempfile and save


From   "Wong, Mitch ,M.D." <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Re: error code with tempfile and save
Date   Thu, 22 May 2003 08:46:12 -0700

Your suggesting worked. Thank you!!  
Instead of changing the programs, I figured I could just change the
temporary directory when STATA starts up via my profile.do

I assume the following line in my profile.do won't cause any problems:

global S_FN c:\stata\temp

Mitch Wong



-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Thursday, May 22, 2003 6:28 AM
To: [email protected]
Subject: st: Re: error code with tempfile and save


Mitch Wong, M.D. ([email protected]) wrote
> I am using STATA 7 on Win2000 platform and I have been using hotdeck 
> and outputst commands. With both programs, I have run into the same 
> error code. Initially when I run these commands, they work fine.
> However, after several uses (even without changing any of my code), I  get
> the following error:
> **in outputst
> - tempfile tmpdta
> - qui save `tmpdta',replace
> invalid 'and'
> r(198);

My best guess at the source of this problem is that Mitch's temporary
directory has a space in it.  If so, the macro `tmpdta' will contain a
space, and the -save- command will fail since the filename is not properly
quoted.  Change the line in question to read

  qui save `"`tmpdta'"',replace

After making this change, Mitch will need to clear the programs in memory,
if any, so that the old version of the program will not be used instead of
the new one he has changed.  Type

  . discard

to clear the programs in memory, and then try re-running the command.

If Mitch continues to face this error even with the changed line, he could
insert a line of debugging code to try to see exactly what is going to be
executed:

   tempfile tmpdta
   display `"try to execute -qui save `"`tmpdta'"',replace-"'
   qui save `"`tmpdta'"',replace

It appears that Mitch is not using Stata 8.  Stata 8, with -set trace on-,
will automatically show lines with macros in them twice--once unexpanded,
and then again after expansion.  This is a great help in debugging such
problems.


--Alan
([email protected])
*
*   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/



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