Announcement

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

  • Bug in spmap

    User-written program spmap is stopping with an error in the following case, which seemingly should be valid:

    Code:
    tempfile c
    copy http://www.mysite.org/mymap `"`c'"'
    
    spmap X using "`c'", id(district)
    The error message is too obvious about the nature of what is going on:
    File X:\statatmp\ST_4524_000001.tmp.dta not found
    r(601);


    The Stata temporary data files are not having a .dta extension, but are otherwise fully qualified and carrying an extension, so no additional extension .dta should be added, which spmap is apparently trying to do.

    I have found no clean workaround for this issue.

    My advice would be to first probe if the file specified by the user is actually present, and if so, use as is. Otherwise add the .dta extension and probe again. That would allow to use temporary files in this context.

    Best, Sergiy Radyakin


    PS: spmap is by Maurizio Pisati, University of Milano Bicocca (Italy)
    https://ideas.repec.org/c/boc/bocode/s456812.html

  • #2
    so no additional extension .dta should be added, which spmap is apparently trying to do.
    Yes, line 90, just after the syntax adds .dta to the `using' macro. If you comment out line 90 it runs without issue.

    lines 89-91:
    Code:
    /* Check using file */
    if (substr(reverse("`using'"),1,4) != "atd.") local using "`using'.dta"
    capture confirm file "`using'"

    Comment

    Working...
    X