Previous Page | Next Page

Working with Numeric Variables

About Numeric Variables in SAS

A numeric variable is a variable whose values are numbers.

Note:   SAS uses double-precision floating point representation for calculations and, by default, for storing numeric variables in SAS data sets.  [cautionend]

SAS accepts numbers in many forms, such as scientific notation, and hexadecimal. For more information, see the discussion on the types of numbers that SAS can read from data lines in SAS Language Reference: Concepts. For simplicity, this documentation concentrates on numbers in standard representation, as shown here:
1254
 336.05
-243

You can use SAS to perform all kinds of mathematical operations. To perform a calculation in a DATA step, you can write an assignment statement in which the expression contains arithmetic operators, SAS functions, or a combination of the two. To compare numeric variables, you can write an IF-THEN/ELSE statement using logical operators. For more information on numeric functions, see the discussion in the "Functions and CALL Routines" section in SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page