Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • starting multiple stata applications via a do-file

    Good Morning everybody,

    I have a do-file which works first with a dataset A, and afterwards with a dataset B.

    The syntax is written in a way, that at the end of the dofile a stata application will be opened with dataset B.

    Is there a command which opens two different stata applications, hence, that at the end of the do-file both dataset are open?

    Because I am not sure whether my description makes that much sense, here an example:

    Code:
    ---> open stata application 1
    use "dataset A"
    do "xxxxx"
    save "yyyy"
    
    ----> open stata application 2
    use "dataset B"
    do "xxxxx"
    save "yyyy"
    I cannot use two different do-files here, and I also know that it is possible two open two stata applications manually- but that doesnt really help me here
    It might be also good to know that I use UltraEdit and not the implemented stata do-file.

    Best Regards

    Marius
    Last edited by Marius Kaltenbach; 17 Oct 2018, 01:24.

  • #2
    Hi Marius,
    I am not sure if I understand correctly. In Stata it is not possible to open two datasets at the same time, i.e. you cannot open dataset A and dataset B at the same time.Is this what you mean with both datasets are open?

    Why can you not use two do files? If you could use two do files, then you can parallelise them using commands such as multishell (https://www.statalist.org/forums/forum/general-stata-discussion/general/1456028-new-package-on-ssc-multishell), qsub or parallel.

    Jan

    Comment


    • #3
      Hi Jan, thank you for your answer.
      I don't want to open two datasets in one instance, but rather tell Stata that for the next dataset a new instance should be opened (so that the dataset in the old instance does not get overwritten by the new one).
      The three commands you mentioned are still good to have, but not exactly what I was looking for.
      Last edited by Marius Kaltenbach; 17 Oct 2018, 06:16.

      Comment


      • #4
        Why do you save the datasets with the same name and not with different ones? For example "yyyy_1" and "yyyy_2". Alternatively you can use two or more temporary datasets, but once again, you would have two datasets.

        A more complicated way is to write a do file, which opens the dataset and start this do file with winexec. For example if you call the do file "OpenDataset.do" and it only contains:
        Code:
        use "PATH/yyyy.dta"
        then you can open a new Stata instance and run the do file with
        Code:
        winexec "C:\Program Files (x86)\Stata15\StataSE-64.exe" do "PATH/OpenDataset.do"
        You need to adjust the paths to the Stata.exe, the dataset and the do file which opens the dataset.

        Comment


        • #5
          Thank you Jan, that looks like what I am looking for!

          Comment

          Working...
          X