How to: |
You can call a function in WHEN criteria as part of a Boolean expression.
WHEN({function|value} relation {function|value});
or
WHEN NOT(function)
where:
Is a function.
Is a value or logical expression.
Is an operator that determines the relationship between the value and function, for example, LE or GT.
This request checks the values in LAST_NAME against the result of the CHKFMT function. When a match occurs, the request prints a sort footing.
TABLE FILE EMPLOYEE PRINT DEPARTMENT BY LAST_NAME ON LAST_NAME SUBFOOT "*** LAST NAME <LAST_NAME DOES MATCH MASK" WHEN NOT CHKFMT(15, LAST_NAME, 'SMITH ', 'I6'); END
The output is:
LAST_NAME DEPARTMENT --------- ---------- BANNING PRODUCTION BLACKWOOD MIS CROSS MIS GREENSPAN MIS IRVING PRODUCTION JONES MIS MCCOY MIS MCKNIGHT PRODUCTION ROMANS PRODUCTION SMITH MIS PRODUCTION *** LAST NAME SMITH DOES MATCH MASK STEVENS PRODUCTION