Enform Plus Reference Manual
Enform Plus Language Elements
Enform Plus Reference Manual—422684-001
3-25
Range of Values in Logical Expressions
In this example, the logical expression is evaluated as true only if the field begins with a
value in which COMPAQ is in uppercase characters.
The BEGINS WITH operator can be used only with fields specified as alphanumeric in
the data dictionary. A field is alphanumeric when its corresponding data description
entry is specified as PIC X.
The CONTAINS operator determines if a field contains a specified alphanumeric string.
For example, the following determines whether the empname field contains the value
GEORGE:
empname CONTAINS "GEORGE"
Enform Plus does not support variable-length parameters. The following query, in which
xyz has been defined as a five-character field, will not work if you pass xyz a three-
character value:
PARAM xyz INTERNAL A5;
OPEN order;
LIST order WHERE KEY BEGINS WITH "xyz";
Enform Plus looks for a value of "xyz" plus two blanks, and the query fails.
Range of Values in Logical Expressions
A field can be compared to a range of values in a logical expression. In the range, value-
1 must be less than value-2. Values used in a range can be either numeric literals or
string literals.
Specifying field EQ value1 THRU value2 is equivalent to specifying:
field-name GE value-1 AND field-name LE value-2
A range can contain a numeric literal if the field being examined is defined as numeric
in the data dictionary. The inventory field of the parts file is defined as PIC 999. The
following logical expression is evaluated as true if the value of the inventory field falls
within the range of 5 to 15, including the values 5 and 15:
inventory EQ 5 THRU 15,
A range expression can also use a string literal if the field being examined is defined as
alphanumeric in the data dictionary. The partname field is defined as PIC X(18).
The following logical expression is evaluated as true if partname field contains a
value that falls with in the range of A to L:
partname EQ "A" THRU "LZZZZZZZZZZZZZZZZZ"
Note that the second string literal is 18 characters long, the length of the partname
field. Specifying the literal in this manner ensures that all of the part names beginning
with L are included.