The example I gave didn't work properly - you can't tokenize after a
tokenize without destroying the original set of positional macros you
were looping over. The following better illustrates what I was trying
to do:
local test 1 2 3 | 4 5 6| 7 8 | 9
tokenize `"`test'"' , parse("|")
local i = 1
while "``i''" != "" {
local group`i' = "``i''"
local ++i
macro shift // this advances over the token and allows i to progress 1,2,3
}
local m = `i' - 1
local i = 1
forvalues i = 1/`m' {
tokenize `group`i''
local j = 1
while "``j''" != "" {
di "Group i=`i' is: `group`i'' and subitem j=`j' is: ``j''"
local ++j
}
local ++i
}
Thanks again,
DCE
*
* 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/