user manual
137
CLEM Language Reference
Function
Result
Description
max_n(LIST)
Number
Returns the maximum value from a l i st of numeric fields or
null if all of the fiel d values are null. For more information,
see the topic Summarizing Multiple Fields 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 i nformation, see th e
topic Summarizing Multiple Fields 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 thi rd field listed contains the
minimum, the index value 3 is retu rned. If multiple fields
contain the minimum value, the on e listed first (leftmost)
is returned. For more information, see the topic Working
with Multiple-Response Data 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 ti me values. Returns a true
value if TIME1 is before TIME2.
value_at(INT, LIST)
Returns the value of each l isted 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 l i sted fields).
All storage types supported.
Logical Functions
CLEM expres sions can be used to perform logical opera tions.
Function
Result
Description
COND1 and COND2
Boolean
This operati on is a logical conjunction and returns a true
value if both COND1 and COND2 are true. If COND1 is
false, then COND2 is n ot evaluated; thi s makes it possible
to have conjunctio ns 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 t rue. 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. Oth erwise, this operation returns
a value of 0.
if COND then EXPR1 else
EXPR2 endif
Any
This operation is a conditio nal evaluation. If COND
is true, this operation returns the result o f 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 tru e, this operation returns the result of
EXPR1. Otherwise, if COND2 is true, this operation
returns the res ult of evaluating EXPR2. Otherwise, the
result of evaluating EXPR_N is returned.