Announcement

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

  • MAC OSX directory

    Hello,

    I am using a Mac OS X, and I am sharing a do file with others who are using PC.

    I need to covert the codes into Mac version and I would like some help.

    For the working directory:
    global maindir1 "/Users/__/desktop/..."
    works fine, but

    capture use "/maindir1/....dta",clear
    does not work. (capture use "$maindir/....dta", clear does not work either)

    Can anyone help me fix the route to use the main directory?

    Thank you very much!

  • #2
    Would you mind sharing the actual commands and output/errors? (anonymize if you must, but a more complete path will help confirm that isn't the problem)
    "Does not work" isn't descriptive enough in this case, the error can give us (and you) important clues.

    In this case you probably are pointing the global macro to a directory that doesn't exist. You should verify the path to the directory you are trying to point to with the macro.

    Incidentally, global maindir1 "/Users/__/desktop/..." runs without error because the global macro is set successfully. The likely problem is that the macro isn't pointing where it should.
    Last edited by Arthur Morris; 21 Feb 2020, 00:44.

    Comment


    • #3
      Hi,

      Thank you for the reply.

      The global directory command is:

      else if "`c(username)'"=="eddie"{
      global maindir1 "/Users/Eddie/Desktop/Project/Data"
      global maindir2 "/Users/Eddie/Desktop/Project/Data"


      and later on I would like to use the data from this directory:

      capture use "$maindir1/__.dta",clear

      I have the problem using the main directory.

      Thank you for the help!

      Comment


      • #4
        This command was subsequently reposed and replied to at

        https://www.statalist.org/forums/for...rectory-mac-os

        Comment

        Working...
        X