ASSIGN LIST statement Format 2 (Create list)

Function

The Format 2 ASSIGN LIST statement copies a list or performs a set operation on lists in order to create a list from the results. The Format 2 ASSIGN LIST statement can also rename a list.

Privileges

Owner of the list

The owner of a list can create lists from that list.

Format 2: Creating a list from a list; renaming a list

ASSIGN LIST list-name FROM list-name-1
    [{{AND|OR|AND NOT|ANDNOT} list-name-2|FOR ALTER LIST}]

Operands

Specifies a name for the list that is to be created.

If an existing list name is specified, the existing list is deleted and a new list is created.

The lists that are specified in list-name-1 and list-name-2 must be derived from the same base table.

The list names specified in list-name, list-name-1, and list-name-2 must be unique.

list-name-1
Specifies a list that is to be copied.
list-name-1 AND list-name-2
Specifies lists from which a set product is to be derived.
list-name-1 OR list-name-2
Specifies lists from which a set union is to be derived.
list-name-1 {AND NOT | ANDNOT} list-name-2
Specifies lists from which the set difference is to be derived.
list-name-1 FOR ALTER LIST
Specifies a new name for the list.

Common rules

See the rules for Format 1.

Notes

See the notes for Format 1.

Examples

[Figure]

  1. Create from table T1 a list (LIST1) of those rows with the value Y in the CHECK1 column:

    ASSIGN LIST LIST1 FROM (T1) WHERE CHECK1='Y'

    [Figure]

  2. Create from table T1 a list (LIST2) of those rows with the value Y in the CHECK2 column:

    ASSIGN LIST LIST2 FROM (T1) WHERE CHECK2='Y'

    [Figure]

  3. Create a list (LIST3) from the set product of LIST1 and LIST2:

    ASSIGN LIST LIST3 FROM LIST1 AND LIST2

    [Figure]