Previous Topic: Use of Parentheses

Next Topic: Primary File


Order of Execution

Multiple operations in a single instruction are executed from left to right in the following priority sequence:

Example:

Consider the following formula and the instruction to execute it for each record:

CPU TIME
WORK FIELD = -----------------------      * 100
              CPU TIME + OVRHD TIME
COMPUTE WORK FIELD(.2) = (CPU TIME / (CPU TIME + OVRHD TIME)) * 100

CA JARS Wizard carries out this instruction as though it was written as several instructions in the following sequence:

COMPUTE WORK FIELD(.2)  =  CPU TIME + OVRHD TIME,
        WORK FIELD  =  CPU TIME / WORK FIELD,
        WORK FIELD  =  WORK FIELD * 100