[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: variables into a macro

From   "Austin Nichols" <>
Subject   Re: st: variables into a macro
Date   Sat, 3 Nov 2007 12:28:37 -0400

In addition to
unab v: _all
di "`v'"
di r(varlist)

another way is available via -syntax- e.g.

sysuse auto, clear
syntax [varlist]
di "`varlist'"

which is a handy trick in a do-file in addition to being invaluable in
-program-s since you can supply a varlist to your do-file, or (by
default) let it operate on all variables.

On 11/3/07, Maarten buis <> wrote:
> --- Philipp Rehm <> wrote:
> > ds _all
> > di "`r(varlist)'"
> >
> > But you may want to select variables into a macro, based on the
> > patterns of their name (or other characteristics). Again, -ds- is
> > very helpful here.
> An extended version is -ds3- by Nick Cox downloadable from -ssc-
> --Maarten
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index