Announcement

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

  • -sysuse dir- lists sysuse files and data files in current directory (Stata v17.0)

    The title says it all really.

    . ! ls *.dta

    iris.dta
    results.dta
    samples.dta
    sidanius.dta
    speed.dta

    . sysuse dir
    auto.dta census.dta network1.dta sandstone.dta uslifeexp.dta
    auto16.dta citytemp.dta network1a.dta sidanius.dta uslifeexp2.dta
    auto2.dta citytemp4.dta nlsw88.dta sp500.dta voter.dta
    autornd.dta educ99gdp.dta nlswide1.dta speed.dta xtline1.dta
    bplong.dta gnp96.dta pop2000.dta surface.dta
    bpwide.dta iris.dta results.dta tsline1.dta
    cancer.dta lifeexp.dta samples.dta tsline2.dta

    Stata 17.0 MP/4, update 09aug2021, Mac OS 10.14.6 ("Mojave")

  • #2
    -sysuse- use example dataset installed with Stata, so why should -sysuse dir- return dta files in current dir which is not a example dataset. (reported to tech support)
    Last edited by Bjarte Aagnes; 24 Sep 2021, 06:50.

    Comment


    • #3
      I think what -sysuse- does is sensible, but then it is the documentation which may be misleading, which reads:

      Code:
      List example Stata datasets installed with Stata
      
              sysuse dir [, all]
      However, all -sysuse dir- does is recursively search within all paths of -c(adopath)- and lists out any and all *.dta files that it finds within. On the one hand, this is sensible so that example dataset names are not hardcoded into the command. However, by including all of the -adopath- it is no longer restricted to Stata's example datasets.

      Comment


      • #4
        deleted.
        Last edited by Bjarte Aagnes; 24 Sep 2021, 10:31.

        Comment


        • #5
          I was also confused by this today. I found that on my Mac, I was able to get -sysuse dir- to display only the example data sets by first typing -cd- to change my working directory back to the main directory on my computer. It was previously set to the folder I have other data sets in. This should work so long as you do not have Stata data files in your main directory.

          Comment


          • #6
            Originally posted by Craig Kerr View Post
            I was also confused by this today. I found that on my Mac, I was able to get -sysuse dir- to display only the example data sets by first typing -cd- to change my working directory back to the main directory on my computer. It was previously set to the folder I have other data sets in. This should work so long as you do not have Stata data files in your main directory.
            This is not how the documented function of -sysuse dir- works. The current working directory is irrelevant to the function of -sysuse-.

            Comment


            • #7
              Originally posted by Leonardo Guizzetti View Post

              This is not how the documented function of -sysuse dir- works. The current working directory is irrelevant to the function of -sysuse-.
              Documented or not, this is how it's currently working on my Mac.

              Comment


              • #8
                Originally posted by Craig Kerr View Post

                Documented or not, this is how it's currently working on my Mac.
                This might be worth flagging to Technical Support then.

                Comment

                Working...
                X