Previous Topic: FIND / GET Comparison-ExpressionNext Topic: FIND / GET and COMPUTE Field-Reference Clause


Expression

Expression is used in the WHERE criteria clause and in the COMPUTE GROUP BY HAVING criteria clause. Expression can include fields of the following data types:

Expressions that include bit fields, nonnumeric fields, or nonnumeric constants are flagged as errors.

Syntax:

►►─┬─────┬─┬─ (expression) ────────┬──────────────────────────────────────────►
   └─ - ─┘ ├─ data-value ──────────┤
           ├─ field-reference ─────┤
           └─ function-expression ─┘

 ►─┬─ + ─┬─┬─────┬─┬─ (expression) ────────┬──────────────────────────────────►◄
   ├─ - ─┤ └─ - ─┘ ├─ data-value ──────────┤
   ├─ * ─┤         ├─ field-reference ─────┤
   └─ / ─┘         └─ function-expression ─┘

Syntax rules:

-

Minus sign denotes a negative value in the expression.

(expression)

Allows you to nest expressions. Parentheses override the standard order of precedence.

data-value
field-reference

Note: For more information, see FIND / GET and COMPUTE Field-Reference Clause and DISPLAY and SORT Field-Reference Clause, later in this chapter.

function-expression

Allows you to use built-in aggregate functions to evaluate data. You can nest built-in functions.

+ - * /

Specify the arithmetic operation to be performed, as follows:

When evaluating expressions, CA OLQ observes the standard order of precedence: multiplication, division, addition, and subtraction, from left to right, with operations in parentheses resolved first.

For more information:

Coding Considerations

Built-In Functions and Syntax