The AND (logical AND) is typically used within the context of a CASE or IF statement. The logical AND function takes the result of two (2) or more other conditions and returns a true (1) if all of the logical conditions are true. If at least one of the conditions within the AND function is not true, a false (0) value is returned.
Category
Boolean
Syntax
<condition> AND <condition>
Parameter and Description
Parameter | Description |
---|---|
condition | One (1) or more conditions that will be used within the AND function to determine if all of the functions are true (1). |
Example
Determine which employees have a yearly salary (YR_WAGE) greater than $75,000 and worked less than 40 hours last week (HRS_WORKED). If both of these conditions are true, map the constant Y into target field CHECK. Otherwise, map the constant N into the target field CHECK.
IF YR_WAGE > 75000 AND HRS_WORKED < 40
{
TGT_DS.CHECK = 'Y'
}
ELSE
{
TGT-DS.CHECK = 'N'
}