Hi
I have an index (not unique) on a dataset.
Why does
SET dataset KEY=mykey;
SET dataset KEY=mykey;
SET dataset KEY=mykey;
SET dataset KEY=mykey;
give different results to
i=4;
DO WHILE(i>0);
SET dataset KEY=mykey;
i=i-1;
END;
The first gives the first occurrence of a record matching the key FOUR times whereas the second code extract gives the first 4 records that match the key.
This may seem a trivial example but I'm trying to pin down a more complex case.
I am given a list of names. I have to find all records in my dataset containing the names. I the same name happens to occur twice AND THSE TWO OCCURRENCES ARE ADJACENT then the second lookup fails. (the good old /unique problem)
Can anyone explain what is happening with the above code extracts ?
Barry
I have an index (not unique) on a dataset.
Why does
SET dataset KEY=mykey;
SET dataset KEY=mykey;
SET dataset KEY=mykey;
SET dataset KEY=mykey;
give different results to
i=4;
DO WHILE(i>0);
SET dataset KEY=mykey;
i=i-1;
END;
The first gives the first occurrence of a record matching the key FOUR times whereas the second code extract gives the first 4 records that match the key.
This may seem a trivial example but I'm trying to pin down a more complex case.
I am given a list of names. I have to find all records in my dataset containing the names. I the same name happens to occur twice AND THSE TWO OCCURRENCES ARE ADJACENT then the second lookup fails. (the good old /unique problem)
Can anyone explain what is happening with the above code extracts ?
Barry