Statalist The Stata Listserver


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

st: duplicated observations when appending several files


From   [email protected]
To   [email protected]
Subject   st: duplicated observations when appending several files
Date   Mon, 11 Jun 2007 19:28:20 +0200


Dear all,
I have a problem when I append a list of files (named from v2.dta to v66.dta) 
to the current dataset (v1.dta). Incidentally, all these files contain the 
same variables, in the same order.
The command I use is the following:

**************************************
use c:\data\v1
forvalues i = 2(1)66 {
append using "c:\data\v`i'"

          }
**************************************

when I look at the data in the resulting dataset many observations are 
duplicated, as Stata had appended twice the same file. I have also tried to 
use the alternatives: 

**************************************
foreach file in v2.dta v3dta v4.dta��.v66.dta {
                append using "`file'"
        }
**************************************

and:

**************************************
local i = 1
	use c:\data\v`i', clear
	while `i'<=66 {
		append using c:\data\v`i'
		local i = `i' + 1
	}
**************************************

but I always get the same strange result.
Thank you in advance for any suggestions


Mariarosaria


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

*
*   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