Announcement

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

  • local all variables

    I would like to reference all variables using local or tokenize. But I don't know how to reference the whole variables. Could you let me know how to do them?

  • #2
    Code:
    sysuse auto, clear
    ds
    local varlist `r(varlist)'
    display "`varlist'"

    Comment


    • #3
      The command
      unab foo: _all
      will place all of the variables in the current dataset in the local macro foo.

      Comment


      • #4
        describe, varlist is here an alternative to ds. There is nothing wrong with Sergiy's solution, but since ds was introduced, describe has been extended to do this directly.

        Comment

        Working...
        X