EVALUATE
EVALUATE
Evaluates expressions while the main command processes a set of records.
Syntax
EVALUATE «expression»
Parameters
expression | Any valid expression, but usually an assignment using LET and an aggregate function. If expression is complex, it must be enclosed in parentheses. |
Example
change all Employees where LastName = Smith
let Salary = 1.1 * Salary
evaluate (let ExtraCost = $ total(Salary * 0.1))
Determines how much extra money is needed after all employees named Smith are given a 10% pay raise.
let RegTot[1]=0 RegTot[2]=0 RegTot[3]=0
compute Sales
evaluate (let RegTot[RegNum] = RegTot[RegNum] + SalesAmt)
Calculates total sales by region assuming three regions were served by the same sales force.
See Also