Announcement

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

  • Why won't .ado work via .ado file, but will when pasted into my .do?

    I'm trying to get Emily Oster's psacalc.ado to work on Stata 16 for Linux on a server without Internet access. (I'm not sure if the specifics of the program are relevant, but maybe--the psacalc files are available on the Download tab here: https://ideas.repec.org/c/boc/bocode/s457677.html)

    Anyway, since Stata can't access the Internet and I can't use ssc install, I uploaded the .ado files to my ~/ado/personal/ folder. This works for several other .ado files that are in that directory. However, with psacalc.ado, I get the following error:

    "remote connection failed --see help r(677) for troubleshooting
    http://fmwww.edu/repec/bocode/m/ either
    1) is not a valid URL, or
    2) could not be contacted, or
    3) is not a Stata download site (has no stata.toc file).
    (error occurred while loading psacalc.ado)"

    So it would seem likely that the error is in psacalc.ado, except that if I copy and paste the entire contents of the psacalc .ado file (both the program block and the mata block) into the top of the .do file where I want to use the .ado, everything works fine. It's just annoying to have to copy the 600 lines of code into every .do file.

    So essentially, the folder works, and psacalc works, but psacalc in the folder doesn't work. Any suggestions?

  • #2
    Very odd. I had a theory of the source of the problem, but looking at the two ado file did not bear out my theory. Sigh.

    Do try
    Code:
    which psacalc.ado
    to confirm that the psacalc.ado it loads is the one in your PERSONAL directory and not something else.

    Here is a hack that may save you the copying and pasting.
    Code:
    include psacalc.ado, adopath
    I haven't tested this, my apologies if it's a dead end.

    Comment


    • #3
      Thank you, William. This revealed to me that Stata was actually using an older version of psacalc that tried to load a dependent .ado using ssc install, and that was the actual issue.

      Comment

      Working...
      X