Evaluate

PURPOSE:  The EVALUATE command defines a new Find Subset (FS) object (see FIND command) by performing logical operations on two or more Find Subsets.  These FS’s can be the current FS or any previously saved FS’s.

Syntax

EVALUATE {INTER/SECTION/; UNION; UNIQUE; DIF/FERENCE;}

{FROM; OF;} \\{CURRENT; FS name}\\

INTER/SECTION/

specifies the logical operator AND for the operation.  The new FS contains only those records that appear in all of the specified FS’s.

UNION

specifies the logical operator "exclusive OR" for the operation.  The new FS contains records that appear in any of the specified FS’s.  No records will be included twice.

UNIQUE

specifies the logical operator "exclusive OR"  for the operation.  The new FS contains records that appear in any but not more than one of the specified FS’s.

DIF/FERENCE

specifies the logical operator DIFFERENCE for the operation.  The new FS contains records from the first FS that are not included in any other specified FS’s.

FROM; OF

are synonymous; one or the other must be specified.

CURRENT

specifies the current FS.

FS name

specifies a previously saved FS.

EXAMPLE

The following commands illustrate the INTERSECTION, UNION, UNIQUE, and DIFFERENCE operations.  Two EXTRACT commands are used first to show the FS’s that are going to be used in the EVALUATE commands.  Notice that the DIFFERENCE option produces different subsets depending on the order in which subsets are listed in the command.

*USE DS BOOKS_DBM2
*EXTRACT SHOW TITLE_CODE,1B,PRICE,1B,TYPE_CODE
CP2264   20.00 computer
CP3896   19.99 computer
FL0839   70.00 for_lang
FL1757   109.50 for_lang
SF4567   77.00 sci_fi
SF6555   87.90 sci_fi
6 Record(s) Processed
*RESTORE FS BONUS
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1B,TYPE_CODE
FL0839   70.00 for_lang
FL1757   109.50 for_lang
SF4567   77.00 sci_fi
SF6555   87.90 sci_fi
4 Record(s) Processed
F*RESTORE FS FIRST
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1B,TYPE_CODE
SF4567   77.00 sci_fi
SF6555   87.90 sci_fi
2 Record(s) Processed
F*EVALUATE INTERSECTION FROM FS FIRST, FS BONUS
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1b,TYPE_CODE
SF4567   77.00 sci_fi
SF6555   87.90 sci_fi
2 Record(s) Processed
F*EVALUATE UNION FROM FS FIRST, FS BONUS
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1b,TYPE_CODE
FL0839   70.00 for_lang
FL1757   109.50 for_lang
SF4567   77.00 sci_fi
SF6555   87.90 sci_fi
4 Record(s) Processed
F*EVALUATE UNIQUE FROM FS FIRST, FS BONUS
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1b,TYPE_CODE
FL0839   70.00 for_lang
SF4567   77.00 sci_fi
2 Record(s) Processed
F*EVALUATE DIFFERENCE FROM FS FIRST, FS BONUS
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1b,TYPE_CODE
0 Record(s) Processed
F*EVALUATE DIFFERENCE FROM FS BONUS, FS FIRST
F*EXTRACT SHOW TITLE_CODE,1B,PRICE,1b,TYPE_CODE
FL0839   70.00 for_lang
FL1757   109.50 for_lang
2 Record(s) Processed

NOTES:  FS’s are commutative for all operators except DIFFERENCE; i.e., DIFFERENCE is the only operator affected by the ordering of the FS’s in the EVALUATE command.

Refer to the discussion of the FIND command for more information on FS’s.

At least two FS’s are required, and more are allowed.  The number of FS’s that can be evaluated is limited only by the length allowed for a command string.

SEE ALSO:  FIND, RESTORE, KEEP