Calling a Function From a DEFINE, COMPUTE, or VALIDATE Command

How to:

You can call a function from a DEFINE command or Master File attribute, a COMPUTE command, or a VALIDATE command.

Syntax: How to Call a Function From a COMPUTE, DEFINE, or VALIDATE Command

DEFINE [FILE filename] 
tempfield[/format] = function(input1, input2, input3, ... [outfield]);
tempfield[/format] = function(input1, input2, input3, ... [outfield]);
tempfield[/format] = function(input1, input2, input3, ... [outfield]);



Is the data source being used.


Is the temporary field created by the DEFINE or COMPUTE command. This is the same field specified in outfield. If the function call supplies the format of the output value in outfield, the format of the temporary field must match the outfield argument.


Is the format of the temporary field. The format is required if it is the first time the field is created; otherwise, it is optional. The default value is D12.2.


Is the name of the function.

input1, input2, input3...

Are the arguments.


Is the field that contains the result, or the format of the output value enclosed in single quotation marks. This is required only for external functions.

In Dialogue Manager, you must specify the format. In Maintain Data, you must specify the name of the field.