Comparing Numeric Variables
Often in a program, you need to know whether variables
are equal to each other, or whether they are greater than or less
than each other. To compare two numeric variables, you can write an
IF-THEN/ELSE statement using logical operators.
The following table
lists some of the logical operators that you can use for variable
comparisons.
Symbol
|
Mnemonic Equivalent
|
Logical Operation
|
=
|
eq
|
equal
|
¬=, ^=, ~=
|
ne
|
not equal to ( the ¬=,
^=, or ~= symbol, depending on your keyboard)
|
>
|
gt
|
greater than
|
>=
|
ge
|
greater than or equal
to
|
<
|
lt
|
less than
|
<=
|
le
|
less than or equal to
|
In this example, the total cost of each tour in ...
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.