You can constrain the scan list by creating a cached version of the file you
want to do the data lookup on an populating it with only the records that meet
your criteria. Create the cached file with NOLOAD, then once you have a PCF
record use a begin at/end at contraint to read the records from the disk file
and write them to the cached file. You will have to OPEN each instance of the
file before the reads and writes. Something like this:
SCRATCH APP FILENAME FAIL 0 CACHE? Y
CREATE APP FILENAME SHARE? Y FAIL 0 CACHE NOLOAD
OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? N (for disk version)
Then to populate:
BEG AT APP FILENAME IN some constraint
END AT APP FILENAME IN some constraint
BEG READ APP FILENAME HOLD 0 KEY IS FILENAME KEY FIELD
OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? Y (for cached version)
WRITE APP FILENAME
OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? N (for disk version)
END READ APP FILENAME
OPEN APP FILENAME SHARE? Y FAIL 0 CACHE? Y (so process will use
cached version)
Now the data lookup should work on the cached file.
You could also build a memory file and do the same thing and have the data
lookup work on the memory file.
|