How to: |
You can call a function from a COMPUTE, DEFINE, or VALIDATE command. You can also call functions from a Dialogue Manager command, a Financial Modeling Language (FML) command, or a Maintain command. A function is called with the function name, arguments, and, for external functions, an output field.
For more information on external functions, see Types of Functions.
Some Maintain-specific functions require that the MNTUWS function library be retrieved when calling the function. For functions that require this, it is specified in the detailed information for that function. For more information on retrieving the MNTUWS library, see How to Access the Maintain MNTUWS Function Library.
function(arg1, arg2, ... [outfield])
where:
Is the name of the function.
Are the arguments.
Is the field that contains the result, or the format of the output value enclosed in single quotation marks. This argument is required only for external functions.
In Dialogue Manager, you must specify the format. In Maintain, you must specify the name of the field.
COMPUTE field/fmt = function(input1, input2,... [outfield]);
or
DEFINE FILE file field/fmt = function(input1, input2,... [outfield]);
or
-SET &var = function(input1, input2,... [outfield]);
where:
Creates a virtual field that may be used in a request as though it is a real data source field.
Calculates one or more temporary fields in a request. The field is calculated after all records have been selected, sorted, and summed.
Is the field that contains the result.
Is the file in which the virtual field is created.
Is the variable that contains the result.
Is the format of the field that contains the result.
Is the name of the function, up to eight characters long.
Are the input arguments, which are data values or fields used in function processing. For more information about arguments, see Supplying an Argument in a Function.
Is the field that contains the result, or the format of the output value enclosed in single quotation marks. This argument is required only for external functions.
In Dialogue Manager, you must specify the format. In Maintain, you must specify the name of the field.
Place the following statement directly after the MAINTAIN command at the top of your procedure:
MODULE IMPORT (MNTUWS);
Information Builders |