O'Reilly logo

Step-by-Step Programming with Base SAS 9.4 by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calculating with Numeric Variables

Using Arithmetic Operators in Assignment Statements

One way to perform calculations on numeric variables is to write an assignment statement using arithmetic operators. Arithmetic operators indicate addition, subtraction, multiplication, division, and exponentiation (raising to a power). For more information about arithmetic expressions, see the discussion in SAS Language Reference: Concepts.
The following table shows operators that you can use in arithmetic expressions.
Table 8.1 Operators in Arithmetic Expressions
Operation
Symbol
Example
addition
+
x = y + z;
subtraction
x = y - z;
multiplication
*
x = y * z
division
/
x = y / z
exponentiation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required