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

Re: st: Selecting part of a LARGE file


From   David Kantor <dkantor@jhu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Selecting part of a LARGE file
Date   Fri, 06 Jun 2003 15:51:19 -0400

At 10:47 AM 6/6/2003 -0500, Glenn Hoetker wrote:
Hi all.

I have two files.  File A has about 5000 unique values of the variable
PATENT, which is 7 characters long.  File B has 16 million observations
and several million unique values for PATENT.
[...]
I attempted using vallist.ado in File A to generate a long local macro
(say, _useme) and then doing

        use FileB if index(patent, "'useme'")

I get 0 observations in this case (even though I know there are some
matches).  From the manual, it appears that index is limited to strings
of 80 characters, anyway.
I agree with Michael Blasnik, that a -merge, nokeep- should work, and the -nokeep- is essential to making this manageable.

Putting that aside, and putting aside the 80-character limitation, the reason that
use FileB if index(patent, "'useme'")
gets no matches at all (when you do expect some) is that it should be...
use FileB if index("'useme'", patent)

-- the arguments are reversed.

Nick Cox replied that you should expect no matches; he didn't say why.


David Kantor
Institute for Policy Studies
Johns Hopkins University
dkantor@jhu.edu
410-516-5404

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index