Purpose
Perform addition, multiplication, subtraction, and division.
Syntax
►►─┬───────────┬──┬────────────┬─ value result-field-name ────────────────────►◄ └─ Compute ─┘ ├─ ROUND ────┤ └─ TRUNCate ─┘
Syntax Rules
Identifies a compound arithmetic operation; it is an optional keyword for simple arithmetic operations unless either parentheses enclose the arithmetic operation or the ROUND/TRUNCATE clause is specified.
Rounds the resulting value to the number of decimal positions defined for the result field. CA Culprit rounds up if the value is .5 or greater; for example, 0.5 is rounded to 1.
Truncates the resulting value to the number of decimal positions defined for the result field.
If one of these options is specified, it must follow the keyword COMPUTE.
ROUND is the default when PROFILE option RELEASE=6 is in effect; TRUNCATE is the default when PROFILE option RELEASE=5 is in effect.
Specifies an arithmetic operation that contains operands and operators, as follows:
An arithmetic expression that contains two operands connected by an operator is a simple arithmetic expression, for which the keyword COMPUTE is optional. An arithmetic expression that contains more than two operands is a compound arithmetic expression, for which the keyword COMPUTE is required.
|
Operator |
Synonym |
Meaning |
|---|---|---|
|
+ |
ADD |
Indicates that the value of the left operand is added to the value of the right operand. |
|
- |
S or MINUS |
Indicates that the value of the right operand is subtracted from the value of the left operand. |
|
X |
TIMES |
Indicates that the value of the left operand is multiplied by the value of the right operand. |
|
/ |
DIVIDE |
Indicates that the value of the left operand is divided by the value of the right operand. If the value of the right operand is zero, a divide exception occurs and the result of the operation is set to zero. |
Nonnumeric data and arithmetic overflows cause error messages. Arithmetic overflows are reported by the extended error-handling facility.
Note: For more information, refer to the CA Culprit for CA IDMS Messages and Codes Guide.
The name of a numeric work field that receives the result of the arithmetic operation. Result-field-name must be defined on a work field parameter.
|
Copyright © 2014 CA.
All rights reserved.
|
|