Filepro-list Digest, Vol 48, Issue 38
Boaz Bezborodko
boaz at mirrotek.com
Wed Jan 30 09:55:36 PST 2008
> Date: Wed, 30 Jan 2008 12:36:50 -0500
> From: Kenneth Brody <kenbrody at bestweb.net>
> Subject: Sort/select processing when sorting by associated fields
> To: filePro mailing list <filepro-list at lists.celestial.com>
> Message-ID: <47A0B5B2.62F4E741 at bestweb.net>
> Content-Type: text/plain; charset=us-ascii
>
> If you have a file with 100 records, and each record has 5 non-blank
> instances of the associated field on which you are sorting, then the
> sort/select processing will be run 500 times, not 100. It will be
> run for each non-blank instance of the associated field used for the
> sort. (This allows you to select only certain instances from within
> your sort/select processing.) If all instances of the field are
> blank within a given record, the first instance will be selected.
>
> You can verify this by creating a simple file. For ease of setting
> this up, create a file with five instances of A1, and add 5 records
> filling in only 3 instances for each record. Then, create an output
> sorted on A1. Finally, create a sort/select processing:
>
> mesgbox "Record " < @rn { "\n at AF = " < @af { "\nA1 = " & A1
>
> When you run the output, you will see that your processing is run
> 15 times -- one time for each non-blank instance of A1.
>
>
How does doing the Sort/Selection process on an indexed NON-associated
field affect this? I'm asking since my approach is obviously messing
things up some since it only ever goes through the first record once
despite how many associated fields there are.
BTW, I found a workaround that I am satisfied with for now. Instead of
jumping to the first instance in the index of records I want to choose,
I pick a spot a little before it. So if 'ba' holds the start date of
the selection set based on index 'O', the line looks like this.
lookup - k=(ba-"1") i=O -nl
It will always start by looking at the postings from a day just before
the one I am looking for.
While this works I am still curious as to how my previous post messed
things up.
Boaz
More information about the Filepro-list
mailing list