Statalist The Stata Listserver


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

st: Foreach Problem


From   "Raphael Fraser" <raphael.fraser@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Foreach Problem
Date   Mon, 30 Oct 2006 16:48:35 -0500

Can some one explain why the following code does not work?

. foreach var of varlist haem_id - haem_nbc {
 2.         local newname substr(`var', 6, .)
 3.         rename `var' `newname'
 4.         }
( not allowed
r(101);

Raphael
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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