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

st: getting Stata to wait until a shell command is finished


From   "Gabriel Demombynes" <[email protected]>
To   <[email protected]>
Subject   st: getting Stata to wait until a shell command is finished
Date   Wed, 19 Jun 2002 11:15:35 -0700

In the middle of my Stata program, I need to call a SAS batch routine (in
Windows) and then have Stata wait until the SAS routine is finished, so that
it can use part of the SAS output. However, when I use the shell command to
call batch SAS, the SAS routine starts, and Stata doesn't wait. How can I
get Stata to wait? I've tried using the sleep command, but then I have to
guess how long SAS is going to take, and that time varies.

I think what I need to do is have Stata check for the existence of the SAS
output file as a condition for continuing, and have it continue to sleep if
the file doesn't exist. I'm sure Stata must have a logical command that
checks for the existence of a file, but I can't find it. I did find the
confirm command, but I can't figure out how to use its output. Please help!

Thanks,
Gabriel

Gabriel Demombynes
Ph.D. Candidate
Department of Economics
University of California-Berkeley


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