Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -cf- problem with var named _merge


From   Phil Schumm <[email protected]>
To   [email protected]
Subject   st: -cf- problem with var named _merge
Date   Wed, 13 Oct 2004 17:51:52 -0500

I believe I may have found a small problem with -cf- when one or both of the files being compared contains a variable named _merge. Consider the following:


input y
1
2
3
end
save foo
gen _merge = y


If I now use -cf- to compare the data in memory to the file "foo", I get:


. cf _all using foo
_merge: 2 mismatches


when in principle I should get:


. cf _all using foo
_merge: does not exist in using


Alternatively, if I save the file again and then compare it against itself, I get:


. save foo, replace
file foo.dta saved

. cf _all using foo
_merge already defined
r(110);


A quick look at cf.ado suggests that the problem is caused by -cf-'s use of -merge-, and that using the _merge option to specify a temporary variable would be one way to solve the problem.


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