Announcement

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

  • Old grammer mac def

    Dear Stata users,

    I have checked an old and worn user-written command, the -unitroot- produced in 1992 or even earlier. There's a piece of code that raise error. And I report the code and set trace on information below. I want to know what is mac def ? And how to bypass this error in versions that > Stata 10 ? Thank you very much.

    Code:
        local rc=_rc
            quietly use `tmpfile', clear
        capture erase `tmpfile'
            mac def S_FN "`dsn'"
        error `rc'
    /*    Rest of program, SRB 6/17/92    */
        local j=0
        while (`j'<=`lags') {
            local j=`j'+1
            mac def S_`j' = `tau`j''
        }
    Code:
      - local rc=_rc
      - quietly use `tmpfile', clear
      = quietly use ......\Temp\ST_e28_000004.tmp, clear
      - capture erase `tmpfile'
      = capture erase ......\Temp\ST_e28_000004.tmp
      - mac def S_FN "`dsn'"
      = mac def S_FN ""
      - error `rc'
      = error 198

  • #2
    This is the old way of defining global macros, presumably before Statacorp made the distinction between local and global scopes. You can see the result of this as follows:

    Code:
    macro define one "one"
    global define two "two"
    macro list

    Comment


    • #3
      The code and trace clearly show an unconditional
      Code:
      error `rc'
      command. What did you expect from this if not an error? I don't see how this is related to macro define.
      Last edited by daniel klein; 18 Jun 2026, 10:52.

      Comment

      Working...
      X