SAMPLE selects the specified number of items from a file, or selects the specified number of items that meet the selection criteria. If a file is very large, this command may be used to test a report format by generating the report for only a small number of items.
Format
SAMPLE [DICT] filename [item-list] [selection] (n) |
Description
The first n items in the file that match the query are selected.
The SSAMPLE command has the same syntax and additionally allows the user to define one or more sort expressions.
The next example selects the first ten items in the CUSTOMERS file alphabetically by last name and then produces a report for these items using a phrase called NEW-FORMAT:
>SSAMPLE CUSTOMERS BY LAST-NAME (10) 10 ITEMS SELECTED. >LIST CUSTOMERS NEW-FORMAT |
See Also
Creating a Select-list (SELECT)
Selecting Items that Contain a String (FIND)