The &SELECT Menu - The Selection Process - Ultramarine.com The &SELECT Menu - The Selection Process

When communicating with MOSES, one must often select data from a set. For example, when one issues a command, he is really selecting one command for processing from a set of valid commands. In contrast, there are cases where one may select more than one item from the set. In either case, data must be given to MOSES so that a selection can be made. In most cases, the data will consist of the names of the items to be selected. Since simply issuing the names can become cumbersome, MOSES uses a more general method, the Selector.

A Selector can be a name, a name containing either @'s or /'s, or a Selection Criteria. Here, a / is a "wild character" which stands for any character, and an @ stands for an arbitrary number of characters. In many cases, the word MATCH will be used. By a match, we mean that two names are equivalent to within the wild characters. As an example, each of the following strings match the other:

     ABCDEFGH
     A/CDEFGH
     A@H

A Selection Criteria is a more general method of selecting data. In essence, it is a name ( :SEL_NAME, which must begin with a : ) with which two sets of selectors are associated. The first set of selectors ( S_NAME(i) ) define a set of names which will be selected. The second set ( E_NAME(i) ) define a set of names which will be excluded.

The objective of the selection process is to take a set of values and to apply a selection rule which will result in a "selected" subset. The selector :SEL_NAME operates on the admissible set in two steps. The first is to search the entire list of values for a match with any of the S_NAMEs. This results in a subset which is then subject to exclusion by the second step. In other words, the results of the first step are checked for a match against any of the E_NAMEs. If a match is found, that item is removed from the selected set.

A special menu is provided to define and examine selection criteria. This menu is entered via the command:


     &SELECT

and the valid commands are:


     END_&SEL

     NAME, :SEL_NAME, -OPTION

     SELECT, S_NAME(1), S_NAME(2), ....., S_NAME(n)

     EXCEPT, E_NAME(1), E_NAME(2), ....., E_NAME(n)

     INFO_SEL, :SEL_NAME,  -OPTION

     LIST_SEL,  -OPTION

The first of these commands define the "current" selection criteria name. All of the commands which follow will deal with the "current" name until it is redefined. If no option is included, then the action which follows will be added to the existing definition of the selection criteria. To "start over" one should use the option -DELETE on the NAME command. This will remove any previous data defined for the selection criteria. The two commands SELECT and EXCEPT are used to define the names for selection and exception respectively. The LIST_SEL command gives a list of selection criteria which have been defined, and the INFO_SEL command gives the specific S_NAMEs and E_NAMEs for the selection criteria :SEL_NAME. Both LIST_SEL and INFO_SEL accept the option -HARD. If this option is omitted, the reports will be written to the terminal, if it is included, they will be written to the output file.

If no S_NAMEs are defined for a given :SEL_NAME, then all of the available list will be selected in the first step, and if no E_NAMEs are defined, then all values selected by the S_NAMEs will be selected. Thus, a :SEL_NAME which has not been defined will select everything.

As an example of how to assemble these commands, consider:

     &SELECT
     NAME :COW
     SELECT 1, 2, 3, 4, M@
     EXCEPT M1, M2, M3
     NAME :DOG
     SELECT D@
     END_&SEL

Here, two selection criteria are defined, :COW and :DOG. The first one selects 1, 2, 3, 4 and everything beginning with M except M1, M2, and M3. :DOG simply selects everything beginning with a D.

In many cases, one can define a selection criteria quickly by using the abbreviated command:


     &SELECT, :SEL_NAME,  -OPTIONS

where the options are:



     -SELECT, S_NAME(1), ....., S_NAME(n)


     -EXCEPT, E_NAME(1), ....., E_NAME(n)

With the abbreviated form of the command, the selectors defined in the example above can be quickly defined by:

     &SELECT :COW -SELE 1, 2, 3, 4, M@ \
     -EXCEPT M1, M2, M3
     &SELECT :DOG -SELE D@