LIST.UNION

LIST.UNION

Top  Previous  Next

 

The LIST.UNION command creates a new named select list from the entries that appear in either of two other named lists. Items that appear in both lists are not duplicated.

 

 

Format

 

LIST.UNION list1 {list2 {tgt.list}} {COUNT.SUP}

 

where

 

list1, list2identify the select lists to be merged. These must correspond to the names of records in the $SAVEDLISTS file. If list2 is omitted, a prompt is displayed for the name.

 

tgt.listis the name of the new list to be created in $SAVEDLISTS. It is valid for tgt.list to be the same as one of the source lists. if tgt.list is omitted, a prompt is displayed for this name.

 

COUNT.SUPindicates that display of the record count in the merged list is to be suppressed.

 

 

The LIST.UNION command allows construction of one select list from two others. The resultant list will contain all of the items that are in list1 plus all of the items in list2 that are not also in list1.

 

The result list will replace any existing list with the name tgt.list. The ordering of tgt.list is undefined.

 

@SYSTEM.RETURN.CODE is set to the number of items in the new list or a negative error code.

 

 

Example

 

LIST.INTER FRANCE.CUSTOMERS MAJOR.CUSTOMERS MERGED.CUSTOMERS

41 records selected.

 

This example merges two previously saved select lists, one holding keys for customers in France, the other for major customers to form a new list containing the major customers in France.

 

 

See also:

LIST.DIFF, LIST.INTER, MERGE.LIST