Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Execute a unix command within stata


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Execute a unix command within stata
Date   Fri, 10 May 2013 15:22:02 -0400

Yes Brian, see help for Stata's command shell.

For example
  shell notepad.exe
starts a notepad on a Windows machine.

You may also examine c(os) variable to make sure your program is
running on the proper platform.

Best, Sergiy

On Fri, May 10, 2013 at 3:07 PM, Brian Wolfe <[email protected]> wrote:
> Is it possible to execute a unix command within stata?  I often flip between stata and sas depending on the project and it would be helpful to be able to execute a sas file from stata.  Usually I'm running stata in batch mode on unix so I'd like to be able to execute a unix command within a do file.  For example when I'm using sas, I can use the command below to execute a stata do file
>
> x 'stata -b do statacommands.do'
>
> Is there an analogous command in stata that would let me run a unix command in the middle of a do file?
>
> Thanks,
>
> Brian
>
> Brian Wolfe
> Indiana University
> Kelley School of Business
> PhD student - Finance
> http://ssrn.com/author=1472451
> [email protected]
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index