4.7.5
COMPUTE
60229400
The COMPUTE statement assigns to data items the value of a numeric data
item, literal, or arithmetic expression.
COMPUTE identifier-l [ROUNDED], [identifier-2 ROUNDED]] ...
{
FROM
t
~QUALS
)
{
identifier-n
~
literal-l
arithmetic-expression
[; ON SIZE ERROR imperative-statement]
The COMPUTE statement allows the user to combine arithmetic operations
without the restrictions on the composite of operands and/or receiving data
items imposed by the arithmetic statements ADD, SUBTRACT, MULTIPLY,
and DIVIDE.
Each identifier must refer to an elementary numeric item, except that
identifiers to the left of the equals sign may describe data items containing
editing symbols.
Literal-l must be a numeric literal. The arithmetic ex-
pression option permits the use of any meaningful combination of identifiers,
numeric literals, and arithmetic operators, parenthesized as required.
The words FROM and EQUALS are equivalent to the equals sign
(=).
The maximum size of each operand is 18 decimal digits.
The identifier-n and literal-l options provide a method for setting the values
of identifier-I, equal to the value of identifier-n or literal-I.
Examples:
COMPUTE COST-PRICE
=
(HOURS
*
RATE + PARTS-COST)
*
(1 + PROFIT-FACTOR).
COMPUTE DATA-I
=
100.
4-23
Need help?
Do you have a question about the 3300 and is the answer not in the manual?