Statalist The Stata Listserver


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

st: Foreach Problem


From   "Raphael Fraser" <[email protected]>
To   [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index