IBM 15 Switch User Manual


 
137
CLEM Language Reference
Function
Result
Description
max_n(LIST)
Number
Returns the maximum value from a list of numeric elds or
null if all of the eld v al ues 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 i s a member of the specied LIST.
Otherwise, a false value is returned. A li st of eld names
can also be specied. For more information, see t he
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 eld containing the minimum
value from a list of numeric elds or 0 if all v al ues are
null. For example, if the third eld listed contains the
minimum, the index value 3 is returned. If multiple elds
contain the minimum value, the one listed rst (leftmost)
is returned. Fo r 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 elds or
null if all of the eld value s 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 eld at offset INT or
NULL if the offset is outside the range of valid values (that
is, less th an 1 or greater than the number of listed elds).
All storage types supported.
Logical Functions
CLEM expressio ns can be used to perform logical operations.
Function
Result
Description
COND1 and COND2
Boolean
This operation is a logical conj unction and returns a true
value if both COND1 and COND2 are true. If COND1 is
false, then COND2 is not evaluated; this m akes it possible
to have conjunctions where COND1 rst 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 t rue 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 con ditional 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 t he result of evaluating EXPR2. Otherwise, the
result of evaluating EXPR_N is returned.