CALCULATE

Evaluates a debugger expression and displays the result.
Category: Manipulating DATA Step Variables

Syntax

CALC expression

Required Argument

expression
specifies any debugger expression.
Restriction:Debugger expressions cannot contain functions.

Details

The CALCULATE command evaluates debugger expressions and displays the result. The result must be numeric.

Example

  • Add 1.1, 1.2, 3.4 and multiply the result by 0.5:
    calc (1.1+1.2+3.4)*0.5
  • Calculate the sum of STARTAGE and DURATION:
    calc startage+duration
  • Calculate the values of the variable SALE minus the variable DOWNPAY and then multiply the result by the value of the variable RATE. Divide that value by 12 and add 50:
    calc (((sale-downpay)*rate)/12)+50