I agree - TRIMming in an Index may be a Bad idea - and SCAN is Great! -K-
----- Original Message ----- From: John Weller Date: Wednesday, January 21, 2015 12:10 pm Subject: RE: boy, I'm rusty To: [email protected] > Better to use IF SEEK(mcity+mstate, 'Cities', 'City'). > Mcity+mstate must > match index so need to be padded to same length as the index > fields, I > wouldn't index on a trimmed field, others may disagree. Also, > suggest SCAN > ENDSCAN better than DO WHILE. > > Try: > > USE h-1b_fy14_q4 ALIAS mastfile in 0 > USE us_cities ALIAS cities in 0 > SELECT Mastfile > SCAN > IF SEEK(mcity+mstate, 'Cities', 'City') > mlat = n3 > mlng = n4 > ENDIF > ENDSCAN > > Regards > > John > > John Weller > 01380 723235 > 07976 393631 > > > > -----Original Message----- > > From: ProfoxTech [mailto:[email protected]] On > Behalf Of > > Virgil Bierschwale > > Sent: 21 January 2015 16:11 > > To: [email protected] > > Subject: boy, I'm rusty > > > > SELECT 0 > > USE h-1b_fy14_q4 ALIAS mastfile > > SELECT 0 > > USE us_cities ALIAS cities > > SET ORDER TO city > > SELECT mastfile > > GO top > > DO WHILE .not. EOF() > > mcity = RTRIM(lca_case12) > > mstate = lca_case13 > > SELECT cities > > SEEK mcity + mstate > > IF FOUND() > > * found it > > mlat = n3 > > mlng = n4 > > ENDIF > > SELECT mastfile > > SKIP > > ENDDO > > RETURN > > > > cities is indexed on rtrim(city) + rtrim(state) > > > > not finding the records.. > > > > what am I missing in the seek portion? > > > > I know about the problem in the found part, just haven't fixed > it yet > > > > thanks, > > > > Virgil > > > > > > --- StripMime Report -- processed MIME parts --- > multipart/alternative> text/plain (text body -- kept) > > text/html > > --- > > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

