__Calculations__

There are four arithmetic operations in EASYTRIEVE PLUS :

* multiplication

/ division

+ addition

- subtraction

/ division

+ addition

- subtraction

Multiplication and division are performed before addition and
subtraction in order from left to right. There must be a space before and after
the arithmetic operators.

__Parentheses in Calculations__Parentheses can be used to override this normal order of operation. Any level of parentheses nesting is allowed. (Operation proceeds from the innermost level to the outermost.)

RESULTS = GROSS - AMT * 1.3

is the same as:

RESULT = GROSS - (AMT * 1.3)

but different from:

RESULT = (GROSS – AMT) * 1.3

__Rounding in Calculations__To round calculations, add a ‘rounding factor’. The ‘rounding factor’ is composed of a decimal point followed by a zero digit for each decimal position in the receiving field followed by the digit 5.

NEWFLD
W 4
P 2

JOB INPUT PERSNL NAME PAY1

NEWFLD = (GROSS * 1.87) + .005

JOB INPUT PERSNL NAME PAY1

NEWFLD = (GROSS * 1.87) + .005

__PRINT__

- The PRINT statement makes
data available for output to a report.

PRINT report-name

Example

IF REG = 25

PRINT RPT1

END-IF

Example

IF REG = 25

PRINT RPT1

END-IF

Only records with a 25 in the REG field are output to the report.

## No comments:

## Post a comment