Technical data
simple-bool-relation
is a simple-condition (bool-condit), an expression, or the negation of either.
bool-condition
is a relation involving two operands joined by a relational operator.
Relational operators can be one of the following:
[NOT] EQUAL ( = ) TO
[NOT] LESS (<) THAN
[NOT] GREATER (>) THAN
GREATER THAN OR EQUAL (>=) TO
LESS THAN OR EQUAL (<=) TO
[NOT] CONTAIN
[NOT] CONTAINS
[NOT] MATCH
[NOT] MATCHES
The relational operator CONTAINS is used to check that a given data item in
the record contains the specified string anywhere within it. At least one of the
operands must be the identifier of a nondatabase item or a nonnumeric literal; the
other operand must be an elementary item in the record being found or fetched.
The relational operator MATCHES checks that a given item in the records
matches the specified pattern string. At least one of the operands must be the
identifier of a nondatabase item or a nonnumeric literal; the other must be an
elementary item in the record being found or fetched.
The pattern string is formed from any character string; however, two characters,
the percent sign ( % ) and the asterisk ( * ), have special meanings. If the percent
sign ( % ) occurs in the pattern string, it will match the current single character
in the item being matched. If the asterisk ( * ) occurs in the pattern string, it will
match any number of characters starting at the current character in the item
being matched. For example:
FIND ALL KEEP-1 WHERE PARTDESC MATCHES ’*DISK*’
FIND ALL KEEP-1 WHERE PARTDESC MATCHES ’*F%%’
To match either the percent sign ( % ) or asterisk ( * ) in the pattern string, precede
it with the caret (that is, to match percent sign ( % ) use caret and percent (^%),
and to match asterisk ( * ) use caret and asterisk (^*)).
Collection Clause
The reserved word WITHIN with set-name or realm-name is called the collection
clause. Use the collection clause to restrict a search to a specific collection
of records in the database. If you do not use the collection clause, the DBCS
searches through all the records in the database to which you have access.
The collection clause specifies the object collection. The following rules govern its
use:
1. When you use WITHIN realm-name, realm records make up the object
collection. The realm currency indicator is called the object currency indicator.
The ordering of the object collection is unspecified.
2. When you use WITHIN set-name, the member records of the current set of
the specified set type make up the object collection. The set type’s currency
indicator is called the object currency indicator. The ordering of the object
collection is the ordering of the records in the current set of the specified set
type.
4–12 Procedure Division