Monday, 29 July 2013

Easytrieve Basic Report Calculation

Calculations

There are four arithmetic operations in EASYTRIEVE PLUS :
*         multiplication
/         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
PRINT
  • The PRINT statement makes data available for output to a report.
PRINT report-name

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