AND-ITEMS

Returns a list comprising all attribute values contained in each of two or more items, or a specified number of times altogether; that is, the intersection of the values.

Syntax

AND-ITEMS {file-specifier} {item-list} {(option}

Syntax Elements

file-specifier as defined in General Conventions.

item-list is a list of item-ids or an asterisk (*) for all items, or can be omitted if provided by an active list from a preceding list-generating command.

Option

n number of times attribute value must occur for inclusion in list (default is number of items).

Comments

Uniqueness of values in an item can be guaranteed by sorting the list with the NEW-SORT-LIST command and specifying the U option.

Examples

:AND-ITEMS BOOKS BOYS PIRATES
42 Items selected.
>SAVE-LIST BPLIST
[241] 'BPLIST' Cataloged.

All values that were in both items BOYS and PIRATES in file BOOKS are now in list BPLIST.

:AND-ITEMS POISONS FATAL CHEMICAL AVAILABLE
7 Items selected.
>SAVE-LIST MSW
[241] 'MSW' Cataloged.

The list in MSW contains all values that were in each item FATAL, CHEMICAL, and AVAILABLE in file POISONS.

Go to top button