Announcement

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

  • using -cmdlog- to export commands to .txt file

    Following the Stata guide (u15.pdf (stata.com),
    the following code should work:

    HTML Code:
    cmdlog using session
    use http://www.stata-press.com/data/r13/census5
    tabulate region [freq=pop]
    summarize median_age
    cmdlog close
    However, it does not in Stata 18. I do not know about earlier versions. Is this a Stata bug?

  • #2
    Asked and answered here. Please don't hijack other threads to repost your questions. It make it difficult for others to find answers to the same question should they have them, and muddies the other thread being repurposed.

    Comment


    • #3
      Follow up: I just tried this code and it works fine on Stata 18 (Windows, revision 15nov2023). If you are still having problems, please report the error that Stata is giving you.

      Comment


      • #4
        I do not obtain any errors. The file is saved as session.txt, but it is an empty file (Windows, 15 Nov 2023).

        Comment


        • #5
          If you ran -cmdlog- as part of a do-file, then it will not save anything. It's only meant to work during interactive use, meaning you entering commands in the Stata window directly, one at a time.

          Comment

          Working...
          X