The EVAL (or EVALUATE) keyword prefixes an expression to be evaluated and used as though it were an I-type defined in the dictionary.
The EVAL keyword prefixes an expression which is handled as a temporary I-type. It may be used as a field for display or in selection or sort clauses.
The expr string conforms to the same rules as I-type expressions. It is compiled by the query processor for use within the command being executed but is not saved in the dictionary. Where the value of expr is a constant, the expression is evaluated only once and then treated as a literal value.
The default display name used for an EVAL expression in the absence of a COL.HDG qualifier is the expression itself.
The default display format and conversion are taken from the first field referenced by the expression. If no fields are referenced, the format defaults to 10L with no conversion. Alternative format or conversion may be specified with the FMT or CONV field qualifiers.
For increased data privacy, the SECURITY configuration parameter can be used to set a mode whereby use of EVAL requires the user to have write access to the file's dictionary. Note that this is the dictionary associated with the file being reported regardless of possible use of the USING clause to select an alternative dictionary.
LIST INVOICES EVAL "SUM(RECEIVED)"
This command processes records from the INVOICES file and reports the record id (probably the invoice number) and the total of the RECEIVED field which is multivalued to allow for more than one payment against an invoice.