Calling a Function From a RECAP Command

How to:

You can call a function from an FML RECAP command.

Syntax: How to Call a Function From a RECAP Command

RECAP name[(n)|(n,m)|(n,m,i)][/format1] =  
function(input1,...,['format2']);

where:

name

Is the name of the calculation.

n

Displays the value in the column number specified by n. If you omit the column number, the value appears in all columns.

n,m

Displays the value in all columns beginning with the column number specified by n and ending with the column number specified by m.

n,m,i

Displays the value in the columns beginning with the column number specified by n and ending with the column number specified by m by the interval specified by i. For example, if n is 1, m is 5, and i is 2, the value displays in columns 1, 3, and 5.

format1

Is the format of the calculation. The default value is the format of the report column.

function

Is the function.

input1,...

Are the input arguments, which can include numeric constants, alphanumeric literals, row and column references (R notation, E notation, or labels), and names of other RECAP calculations.

format2

Is the format of the output value enclosed in single quotation marks. If the calculation's format is larger than the column width, the value appears in that column as asterisks.

Example: Calling a Function in a RECAP Command

This request sums the AMOUNT field for account 1010 using the label CASH, account 1020 using the label DEMAND, and account 1030 using the label TIME. The MAX function displays the maximum value of these accounts.

TABLE FILE LEDGER
SUM AMOUNT FOR ACCOUNT
1010 AS 'CASH ON HAND'      LABEL CASH   OVER
1020 AS 'DEMAND DEPOSITS'   LABEL DEMAND OVER
1030 AS 'TIME DEPOSITS'     LABEL TIME   OVER
BAR                         OVER
RECAP MAXCASH = MAX(CASH, DEMAND, TIME); AS 'MAX CASH'
END

The output is:

                 AMOUNT
                 ------
CASH ON HAND      8,784
DEMAND DEPOSITS   4,494
TIME DEPOSITS     7,961
                 ------
MAX CASH          8,784