Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Append within a loop


From   Camila Mendes <cacamendes85@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Append within a loop
Date   Thu, 12 Jul 2012 16:39:28 -0700

Hi all,

I've created some data in separate folders using a loop, and now I wish to
append all the files (over i, k and l).

Can anyone help me?

foreach i in Female Male{
foreach k in 11 12 13 14 15 16 17 21 22 23 24 25 26 27 28 29 31 32 33 35 41
42 43 50 51 52 {
foreach l in 0a3 4a8 9a11 12+ {
use "$directory\UF `k'\variavel ocupacao\Grupo `l'\data_`i'_`k'_`l'.dta",
clear
}
}
}

Thanks,

Camila
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index