The syntax, SEQUENCE seqname allows a scan to use as part of its input, the result list from a previous scan. This avoids having to re-evaluate an entire previous scan, just to add some more criteria to it.
In interactive applications, this can be very powerful. For example, after performing a scan based on user input, a panel can be displayed informing the user of the number of hits. One option the user can have is to add extra criteria, and see the result of the extra criteria, as applied to the current result list. The display, extra criteria, and so on, cycle could be repeated. By using the previous scan as input, large amounts of system resources can be saved. Also, as the user ascends the nested levels of display, previous results are still valid.
This option is also useful when a scan expression that is too complex to handle in one statement is needed. It can be broken into parts, and the results combined.
For example:
&NDBSCAN MYNDB SEQ=S1 DATA SURNAME = 'SMITH'
&NDBSCAN MYNDB SEQ=S2 DATA DOB LT 600101
&NDBSCAN MYNDB SEQ=RESULTS DATA SEQUENCE S1 AND +
SEQUENCE S2
A scan expression can just include a previous scan result. This is useful when you want to re-sort a scan result without rebuilding as list. For example:
&NDBSCAN DB2 SEQ=S1 SORT=FIELD1 DATA ...scan expr &NDBSCAN DB2 SEQ=S2 SORT=FIELD2 DATA SEQUENCE S1
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |