Announcement

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

  • Tempfile invalid file specification

    [previous code]

    foreach q in ca cb cc cd ce {
    preserve
    gen var = "`q'"
    tempfile ``q''
    save ``q'', replace
    restore
    }

    use `ca' // THIS RETURNS ERROR r(198) invalid file specification

    foreach g in cb cc cd ce {
    append using ``g''
    }

    tempfile alldc
    save `alldc', replace
    ...
    I do not see why I'm returning the error; previously in the code, I have saved tempfiles and then used another tempfile with " use `tempfile' " and it has worked fine. Why not on this occasion?

  • #2
    Solved:
    Tempfile `q'
    Save `name', replace

    I had coded:
    Tempfile ``q''
    Save ``q'', replace

    Comment

    Working...
    X