>The cursors are created within a SCAN through a dataset, and therefore are liable to be created MANY times. Essentially, it becomes a memory management issue.
>
>I've modified the code so that instead of creating a cursor, I simply direct the result set to the query NOCONSOLE. For the bulk of the queries, I'm simply looking for record counts, which is one reason why I'm reusing the cursor alias, and I believe SELECT is faster than a COUNT. If I'm wrong, feel free to enlighten me. So, for each loop, I'm directing 4 to Query and one to Cursor, rather than 5 to Cursor.
>
>Thanks for answering.
>
>John
COUNT should be as fast as SELECT as long as there are index tags for the FOR clause so Rushmore kicks in.