IBM 15 Manual De Usuario

Descargar
Página de 270
137
CLEM Language Reference
Function
Result
Description
max_n(LIST)
Number
Returns the maximum value from a list of numeric fields or
null if all of the field values are null. For more information,
see the topic
in Chapter 7
on p. 115.
member(ITEM, LIST)
Boolean
Returns true if ITEM is a member of the specified LIST.
Otherwise, a false value is returned. A list of field names
can also be specified. For more information, see the
topic
in Chapter 7 on p. 115.
min(ITEM1, ITEM2)
Any
Returns the lesser of the two items—ITEM1 or ITEM2.
min_index(LIST)
Integer
Returns the index of the field containing the minimum
value from a list of numeric fields or 0 if all values are
null. For example, if the third field listed contains the
minimum, the index value 3 is returned. If multiple fields
contain the minimum value, the one listed first (leftmost)
is returned. For more information, see the topic
in Chapter 7 on p. 117.
min_n(LIST)
Number
Returns the minimum value from a list of numeric fields or
null if all of the field values are null.
time_before(TIME1,
TIME2)
Boolean
Used to check the ordering of time values. Returns a true
value if TIME1 is before TIME2.
value_at(INT, LIST)
Returns the value of each listed field at offset INT or
NULL if the offset is outside the range of valid values (that
is, less than 1 or greater than the number of listed fields).
All storage types supported.
Logical Functions
CLEM expressions can be used to perform logical operations.
Function
Result
Description
COND1 and COND2
Boolean
This operation is a logical conjunction and returns a true
value if both COND1 and COND2 are true. If COND1 is
false, then COND2 is not evaluated; this makes it possible
to have conjunctions where COND1 first tests that an
operation in COND2 is legal. For example,
length(Label)
>=6 and Label(6) = 'x'.
COND1 or COND2
Boolean
This operation is a logical (inclusive) disjunction and
returns a true value if either COND1 or COND2 is true
or if both are true. If COND1 is true, COND2 is not
evaluated.
not(COND)
Boolean
This operation is a logical negation and returns a true
value if COND is false. Otherwise, this operation returns
a value of 0.
if COND then EXPR1 else
EXPR2 endif
Any
This operation is a conditional evaluation. If COND
is true, this operation returns the result of EXPR1.
Otherwise, the result of evaluating EXPR2 is returned.
if COND1 then EXPR1 elseif
COND2 then EXPR2 else
EXPR_N endif
Any
This operation is a multibranch conditional evaluation.
If COND1 is true, this operation returns the result of
EXPR1. Otherwise, if COND2 is true, this operation
returns the result of evaluating EXPR2. Otherwise, the
result of evaluating EXPR_N is returned.