Performing Inter-Row Calculations

How to:


The RECAP command enables you to perform calculations on data in the rows of the report to produce new rows. You must supply the name and format of the value that results from the calculation, and an expression that defines the calculation you wish to perform. Since RECAP calculations are performed among rows, each row in the calculation must be uniquely identified. FML supplies default row labels for this purpose (R1, R2, and so on). However, you may assign more meaningful labels. For more information, see Referring to Rows in Calculations.

Top of page

Syntax: How to Define Inter-Row Calculations
RECAP calcname[/format]=expression; [AS 'text']



Is the required command name. It should begin on a line by itself.


Is the name you assign to the calculated value. The name can be up to 66 characters long, and must start with an alphabetic character. This name also serves as an explicit label. For more information, see Referring to Rows in Calculations.


Is the USAGE format of the calculated value. It cannot exceed the column width. The default is the format of the column in which the calculated value is displayed.


Can be any calculation available with the DEFINE command (including IF ... THEN ... ELSE syntax, functions, excluding DECODE and EDIT, and fields in date format). The expression may extend to as many lines as it requires. A semicolon is required at the end of the expression. For more information, see Using Functions in RECAP Calculations and the Using Functions manual.

The expression can include references to specific rows using the default FML positional labels (R1, R2, and so on), or it can refer to rows, columns, and cells using a variety of flexible notation techniques. Note that Rn references can only be used for rows previously evaluated within the model. For more information, see Referring to Rows in Calculations, Referring to Columns in Calculations, and Referring to Cells in Calculations.

AS 'text'

Changes the default title of the row. By default, the name of the RECAP value is displayed as the row title in output. The AS phrase replaces the default. Enclose the text in single quotation marks.

Top of page

Reference: Usage Notes for RECAP