The ssample command creates and sorts a temporary select-list of the first n items in a file that match the specified criteria. This command is useful when testing a small number of items. For example, testing 100 items in a file rather than processing all 10,000 items.
To permanently save the select-list, use the save-list command. When a select-list is saved, you can retrieve it at any time with the get-list command.
A select-list can reference data in any file, not just the file specified in the original ssample statement. If two files have similar items with the same item-IDs, you can create a select-list from one file, then use it to operate on items from the other file.
ssample [DICT] filename [item-list] [selection] [sort-keys] [output] (n)
DICT | Specifies the file dictionary. | |
filename | The name of the file. | |
item-list | A list of individual item-IDs that you want to select or compare against specified criteria. Enclose each item-ID in single quotes. This parameter overrides n. | |
selection | Specifies one or more conditions that an item must meet to be included in the select-list. For a complete description of selection expression syntax, see the list command information. | |
sort-keys | Specifies which attributes to sort and whether to sort them in ascending or descending order. You can use the following modifiers with sort-keys: | |
BY | Specifies which attributes to sort and whether to sort them in ascending or descending order. You can use the following modifiers with sort-keys: | |
BY-DSND | Sorts items in descending order by the specified attribute. | |
BY-EXP | Sorts a multivalued attribute in ascending order and produces a separate line for each value. | |
BY-EXP-DSND | Sorts a multivalued attribute in descending order and produces a separate line for each value. | |
If more than one sort-key is specified in an ssample command line, the system sorts these attributes from left to right (the leftmost sort-key is the most significant). | ||
output | The name of an attribute whose values are to be selected. Each value becomes a separate item-ID in the select-list. | |
n | The number of items to sample. |
The following example creates a select-list containing the first four items in the ORDERS file whose sale date is January 15, 2018:
>SSAMPLE ORDERS WITH DATE = "01/15/18" (4) 4 ITEMS SELECTED.
If you list these items with the list command, they appear in sorted order:
>LIST ORDERS 0134 0156 0179 0234 4 ITEMS LISTED.
get-list command, list command, save-list command, sample command