Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 3 Tools : MIN

MIN
Returns the smaller of two given values. (F)
invocation
smaller = MIN(x, y)
 
Usage Notes
The values passed to MIN must represent numbers, and can be any syntax.
Example
The following rule finds the lowest and highest paid employees by comparing each salary in the EMPLOYEE table.

 
SALARY_RANGE
_ LOCAL HIGHEST,LOWEST;
_ ---------------------------------------------------------------------
_ ------------------------------------------------------------+--------
_ LOWEST = 99999; | 1
_ FORALL EMPLOYEE: | 2
_ HIGHEST= MAX(HIGHEST,EMPLOYEE.SALARY); |
_ LOWEST = MIN(LOWEST,EMPLOYEE.SALARY); |
_ END; |
_ CALL MSGLOG('THE HIGHEST SALARY IS ' || HIGHEST); | 3
_ CALL MSGLOG('THE LOWEST SALARY IS ' || LOWEST); | 4
_ ---------------------------------------------------------------------

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved