SAMPLE

SAMPLE, FIRST

Top  Previous  Next

 

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.

 

 

Format

 

SAMPLE {n}

 

where

 

nis the number of records to be processed. If n is omitted, this defaults to 10.

 

 

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.

 

 

Example

 

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.

 

 

See also:

SORTED.SAMPLE