× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Could you use embedded SQL, select the records into your cursor using
"WHERE field2 <> 'X' AND field1 IN ('A','B','C')"? That should get you
the exact subset of the records in which you are interested.
Alternatively, what about an logical/index that is sorted first by
field2,
then field1, and do something like this (off the top of my head - not
tested!)

SETLL ('X':'A') logicalFile;
READ file;
DOW (field2 = 'X' AND (field1 = 'A' OR field1 = 'B' OR field1 = 'C')
AND
NOT %eof(logicalFile));
// process file
READ file;
ENDDO

HTH,
Adam


Thanks Adam. I'm not currently using SQL cursors to process the file. I'm
still transitioning SQL into my ways of doing things. In fact, I've never
attempted to use SQL for file processing instead of native I/O within a
program. It's on my to-do list but I haven't gotten to it yet. I don't
have a lot of time to spend on this project so now probably isn't the time
to start experimenting. Your idea of the sorted index might work. It
could filter only the records where FIELD2 is blank then I could process
all of the A's, then the B's, the the C's.

Like I said, I'm still learning how to integrate SQL into my routine to
replace DDS. That brings up the question "how do you filter the
selection"? I've created indexes that sort before such as

CREATE INDEX DPWORK3/POLEFLL01 ON DPWORK3/POLEFL
(PLCOMP, PLFRLIB, PLFROUTQ ASC) WITH 1 DISTINCT VALUES;

How do you filter it?


Dave Parnin

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.