Pattern-Match In Logical Expressions; If/Then/Else Expressions - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

ENFORM Language Elements

IF/THEN/ELSE Expressions

Pattern-Match in Logical
Expressions
IF/THEN/ELSE
Expressions
3–28
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.
In a logical expression a field described as alphanumeric in the data dictionary can be
compared to a pattern-match. A pattern-match is actually a comparison template that
the field value is compared to. In the following logical expression, the partname field
is compared to a pattern-match:
partname = [-"DISK" - "MB"-],
OR partname = [-"DISK"-"Mb"-],
OR partname = [-"Disk"-"MB"-],
OR partname = [-"Disk"-"Mb"-],
In the following logical expression, two numbers precede the string-literal indicating
that at least one character but no more than two characters must precede string-literal
in the field value:
partname EQ [1,2 "T"-],
IF/THEN/ELSE expressions yield a value determined by the result of a logical
expression. IF/THEN/ELSE expressions can be used wherever an arithmetic
expression can be used. IF/THEN/ELSE expressions can be nested. The syntax of an
IF/THEN/ELSE expression is:
(IF logical-expression THEN value-1 ELSE value-2 )
logical-expression
is a logical expression that evaluates as true or false.
value-1 or value-2
is a field name, an arithmetic expression, or IF/THEN/ELSE expression, or one of
the following value keywords: NULL, BLANK, BLANKS, ZERO, ZEROS.
If the logical expression is evaluated as true, value-1 is used. If the logical expression is
evaluated as false, value-2 is used. Value-1 and value-2 must be the same data type,
either both numeric or both alphanumeric.
058057 Tandem Computers Incorporated

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents