The CALL statement
You can call an SPL routine or an external routine from an SPL routine using the CALL statement. CALL can execute both procedures and functions. If you use CALL to execute a function, add a RETURNING clause and the name of an SPL variable (or variables) that will receive the value (or values) the function returns.
Suppose, for example, that
you want the scale_rectangles function to call
an external function that calculates the area of the rectangle and
then returns the area with the rectangle description, as in the following
figure.
The SPL function uses a CALL statement that executes the external function area(). The value area() returns is stored in a and returned to the calling routine by the RETURN statement.
In this example, area() is an external function, but you can use CALL in the same manner with an SPL function.