Announcement

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

  • errors after updating Mac OS 10.6 --> 10.10

    I own a copy of Stata 12.1 MP, and for the past 4 years I have used it on a MacBook Pro (using OS X 10.6 Snow Leopard). Recently I had a hard disk failure on that machine, and have since migrated my software and files to a new machine (a MacBook Air, running OS X 10.10 Yosemite).

    I have since found that Stata returns error messages for some routine commands. When I run log using analysis1, Stata returns “file /analysis1.smcl could not be opened” r(603);

    The Help library tells me that r(603) denotes: "This file, although found, failed to open properly. ... You will have to review your operating system's manual to determine why it occurred."

    (It's not clear however where I might start in terms of reviewing the manual for the Mac OS.)

    I also receive error messages when running mkdir — which yields “could not create directory…” r(693);

    Is this perhaps due to Stata 12 features not being supported in Mac OS 10.10? Or is there something I can do to make my version work in the new OS environment, as it did before?

    Advice would be welcome!


  • #2
    I was able to re-create your error message
    Code:
    file /analysis1.smcl could not be opened
    r(603)
    using StataSE 13.1 under OS X 10.10 by being in the OS X root directory (rather than my home directory or some other writable directory) when opening the log.
    Code:
    . cd
    /Users/lisowskiw
    
    . pwd
    /Users/lisowskiw
    
    . log using foo
    ------------------------------------------------------------------------------------------------
          name:  <unnamed>
           log:  /Users/lisowskiw/foo.smcl
      log type:  smcl
     opened on:   2 Aug 2015, 15:34:17
    
    . log close
          name:  <unnamed>
           log:  /Users/lisowskiw/foo.smcl
      log type:  smcl
     closed on:   2 Aug 2015, 15:34:20
    ------------------------------------------------------------------------------------------------
    
    . cd /
    /
    
    . pwd
    /
    
    . log using foo
    file /foo.smcl could not be opened
    r(603);
    
    .
    So I think the first thing you need to do is check that your current working directory is whatever you expect it to be. It's been a long time since I was on OS X 10.6, so it's possible you were able to write in the system root directory under that version. If you indeed were writing in the root directory, I'd recommend changing your habits to write in directories under your home directory.
    Last edited by William Lisowski; 02 Aug 2015, 13:52.

    Comment


    • #3
      If the file exists, you would need to specify the replace option in order to overwrite the file. Before rerunning the do file remember to:

      log c _all

      To make sure all of the file connections are closed. If the problem still persists then you'd need to get into a shell a give yourself write permissions to those directories:

      chmod +rw -R $USER /directory

      Something similar to that would set read and write permissions for the directory "directory" and the flag -R tells the OS to apply the file permissions recursively within the directory. I do nearly all my work on my MacBook and don't find this to be a problem as long as you've set up the file system permissions in advance.

      Comment


      • #4
        William Buchanan gives good advice, but the error message reported by the original poster isn't affected by it. In the example below, we see that log using reports the full path name, so in the original post, Stata must have attempted to create analysis1.smcl in the root ("/") directory rather than in one of the user's directories. And if the log file already exists, Stata reports a different error.
        Code:
        . cd
        /Users/lisowskiw
        
        . cd unwriteable // a directory I created and removed write privileges from
        /Users/lisowskiw/unwriteable
        
        . log using foo
        file /Users/lisowskiw/unwriteable/foo.smcl could not be opened
        r(603);
        
        . cd
        /Users/lisowskiw
        
        . log using foo
        ------------------------------------------------------------------------------------------------
              name:  <unnamed>
               log:  /Users/lisowskiw/foo.smcl
          log type:  smcl
         opened on:   2 Aug 2015, 20:01:50
        
        . log close
              name:  <unnamed>
               log:  /Users/lisowskiw/foo.smcl
          log type:  smcl
         closed on:   2 Aug 2015, 20:01:54
        ------------------------------------------------------------------------------------------------
        
        . log using foo
        file /Users/lisowskiw/foo.smcl already exists
        r(602);
        
        .

        Comment


        • #5
          Thank you both for your input. After typing cd I am indeed able to open log files, which are saved in my user directory.

          However this only works when the command is typed directly into the Command window. When I run the command from a Do-file, I still get the error: r(199) [unrecognized command: log using]

          I have looked back at old log files, and see that in OS 10.6 I was saving them to my user directory (/Users/jedstevenson), rather than to the system root directory.

          Comment


          • #6
            You wrote

            When I run the command from a Do-file, I still get the error: r(199) [unrecognized command: log using]
            You still get an error, but it is now a different error, apparently, and one that has nothing to do with trying to write the log file in the wrong location. If you have quoted Stata correctly, it is telling you that it does not recognize the command log using. That means it's not writing a log at all because it doesn't recognize that you've issued a log command. But things are even more confused. Look at the following, where I deliberately misspell log to try to duplicate your error message.
            Code:
            . logg using
            unrecognized command:  logg
            r(199);
            Note that only the unrecognized command name is included in the error message, not the using clause. So at this point, you possibly have some very strange problem, perhaps deep within Stata, or your paraphrase of Stata's response doesn't correctly represent what happened.

            The Statalist FAQ linked to at the top of every page has much good advice in sections 9-12 about presenting problems in a way that helps the reader understand them and respond to them. You might take a look at them, and in particular note injunction in section 12:

            Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly! If you can, reproduce the error with one of Stata's provided datasets, a small fragment of your dataset, or a simple concocted dataset that you include in your posting
            At this point, I'm reluctant to speculate further on what might have gone wrong given the ambiguity and potential misunderstanding. I'd suggest you try the do-file again, and share with us the commands it is executing and the actual output Stata is providing, preferably using a CODE block as described in the Statalist FAQ to ensure clarity. For additional information, add a pwd command to your do-file just before the log command.

            Comment


            • #7
              I'm very grateful for your attention to this. Your input helped me articulate the issue more clearly in correspondence with a Stata technician, which I've been carrying on in parallel with posts here. They finally helped me figure out the problem. For reference, I quote the advice that clinched it here:

              There appears to be an extraneous character in your -log using- (I was
              able to see it in the Stata 14 do-file editor- possibly an extended
              ASCII character):

              log?sing table4.smcl

              Try deleting the existing -log using- command and retype.
              When I retype the commands into a new do-file, Stata reads them correctly and can run them.

              I'm still not sure where the extra characters crept into my do files, but once I've learned to suspect they might be there, I can work around it.

              Comment

              Working...
              X