An &NDBSCAN statement can generate a list of the records that pass the supplied criteria. The list is optional, and, if it is not needed, just the number of records and the RID of the first passing record can be returned.
This list is treated like a sequence, defined by an &NDBSEQ statement. Records can be read using the &NDBGET statement, using SEQUENCE=name, where name is the same name as specified on the &NDBSCAN SEQUENCE=name.
The list can be read forward or backward, and records can be skipped.
The order of records returned is undefined, unless SORT=expression was specified on the &NDBSCAN statement. This is to allow the scan request to be optimized. If the scan was sorted, the records are ordered based on the nominated sort fields, when retrieving FWD.
A sorted scan list that has exactly one full-field sort key, can be repositioned by &NDBSEQ RESET REPOS, and, as an extra option available only to sequences built by &NDBSCAN, can be repositioned to the record having a specific RID.
The &NDBSCAN statement lets you specify KEEP=YES, to prevent the scan result list being deleted when an EOF response is returned by &NDBGET.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |