Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: macro list parsing

From   Jakob Petersen <>
Subject   Re: st: macro list parsing
Date   Tue, 17 Jan 2012 11:37:53 +0000

Thanks a lot - exactly the problem - Jakob

On 17/01/2012 11:28, Maarten Buis wrote:
On Tue, Jan 17, 2012 at 12:10 PM, Jakob Petersen<>  wrote:
I am trying order the variables on one file according to the order on
another file.
This works well on the example datasets, e.g.

sysuse autornd.dta,clear
local orderlist `r(varlist)'
sysuse auto.dta,clear
order `orderlist',after(turn)

But returns an error code when I attempt the same on my own data:

variable __000005 not found
It means that you have a temporary variable in your original file, and
this variable obviously does not exist in the other files. You can
exclude temporary variables from the local orderlist by typing

ds __*, not
local orderlist `r(varlist)'

The trick is that temporary variables have, for as long as they exist,
names that start with two underscores.

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:


Kind regards,

Jakob Petersen
Institute for Social and Economic Research (ISER)
University of Essex, Colchester, Essex CO4 3SQ, UK
T: +44 (01206) 873683

Understanding Society User Support

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index