Date:         Fri, 1 Jun 90 09:05:53 EDT
Reply-To:     The NOMAD2 Discussion List
Sender:       The NOMAD2 Discussion List
From:         Laurie Martin
Subject:      How about the following?
In-Reply-To:  Help Needed Removing Non-unique occurences from an array:

+++++++ +++++++ +++++++ +++++++ +++++++ +++++++ +++++++ +++++++ +++++++
>>> In reply to Jonathan Willard:

    Problem:

    master first-mast
        item first-item as a1;
        define arr(10) as a1 expr = instance(third-item);
>>>     define newarr(10) as a1 expr =
>>>        sort(arr(findex(freq(arr) ne &nav,all)));
>>>     define arrstring as a10 expr = string(newarr);

    segment first-segm keyed second-item;
        item second-item as a1;
        item third-item as a1;

>>> To explain:  The define for newarr does the following--
>>>   FREQ determines the frequency of occurrence of a value
>>>   and sets duplicates to &NAV.  FINDEX then finds the index
>>>   values of the AVAILABLE values.  Next we find the array
>>>   values and finally SORT them.
>>> The next define for arrstring takes the array and converts it
>>>   into a character string.

    I want arr to contain unique references.  There should be No
duplicates in arr even if there are duplicates in the third-item across
records.  ie., suppose that arr contains:

    1  2  3  4  5  6  7
    -  -  -  -  -  -  -
    A  B  A  D  A  C  B

    I want to view/list/compare it as:

    1  2  3  4
    -  -  -  -
    A  B  C  D   or as   'ABCD'

Note:  I don't want to do this procedurally!  I want to make the
       unique values of third-item available as a defined item!


I really want to say:
    expr = sort(instance(third-item but only if it is unique))
back to index