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

st: problems with sort or merge


From   "Dimitriy V. Masterov" <[email protected]>
To   [email protected]
Subject   st: problems with sort or merge
Date   Wed, 9 Apr 2003 18:41:28 -0500 (CDT)

Dear Statalist,

I am having problem merging two files.  There in a note in [R] sort that
says that Stata sometimes decides that a dataset in not sorted when in
fact it is. Perhaps this is an instance of that.

The program I use is this:
*********************************************************************
# delimit;
set more off;
set trace on;

use C:\GED\temp1.dta;
sort cell1 newvar;
save C:\GED\temp1.dta, replace;

use C:\GED\missing_data1.dta, clear;
sort cell1 newvar;

merge cell1 newvar using C:\GED\temp1.dta;
****************************************************************************

However, I get the following error message:

. merge cell1 newvar using C:\GED\temp1.dta;
using data not sorted
r(5);

When I open any of the two datasets, and describe the variables, both
appear to be sorted by cell1 newvar. Thus I am not sure what I am doing
wrong.

Thank you in advance for your help.


DVM
_______________________________________________________________________________
Dimitriy V. Masterov

Work:
National Opinion Research Center
1155 East 60th St. Room 038
Chicago, IL 60637

Home:
1368 East 53rd St., Apt.3
Chicago, IL 60615

Home: (773)288-0259
Mobile: (773)220-2760
Work: (773)256-6005


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