EQ |
Scroll |
The EQ (equal) function determines whether or not two (2) values to are equal to each other. If the values are equal to each other, a one(1) is returned. Otherwise, a zero (0) is returned. The EQ function operates in the opposite manner as the NE function. The equal sign (=) can also be used to perform this function and is the recommended method.
Category
Mathematical
Syntax
EQ(value1, value2) or value1=value2
Parameter Descriptions
value1 - This parameter specifies the base value that is to be used in the equal comparison. The value may be a field/column of a datastore, a constant value (i.e. ABC) or the result of another Function.
value2 - This parameter specifies the second value that is to be used in the equal comparison. The value may be a field/column of a datastore, a constant value (i.e. ABC) or the result of another Function.
Example
Compare an employee’s yearly salary (YR_WAGE) against their total compensation (TOTAL_COMP) to determine if they are equal. If the YR_WAGE and TOTAL_COMP fields are equal, set variable BONUS to the constant N. Otherwise, set the variable BONUS to the constant Y.
IF YR_WAGE = TOTAL_COMP
BONUS EQ 'N'
ELSE
BONUS = 'Y'