The SAMPLE selection clause keyword causes only a limited number of records to be selected or displayed. The synonym FIRST can be used in place of SAMPLE.
The SAMPLE keyword causes selection or listing of records to terminate after the given number of records have been found.
Sampling occurs after selection criteria but before sorting. Thus it cannot be used to show, for example, only the first three records in sorted order of the whole file. See the SORTED.SAMPLE keyword for a way to do this.
LIST STOCK WITH QTY > 100 SAMPLE 5
This command lists the first 5 items found on the STOCK file that have a QTY field of over 100.