Relational Expressions

  

DEVELOPER

A relational expression tests a specific relationship between two values.  It returns a value of True if the relationship is true and a value of False if the relationship is not true.  A relational expression consists of two constants, variables, or expressions (of the same type) separated by one of the relational operators listed below.

Relational operators is as follows:

Symbol

Purpose
 

=

Equal
 

# or <>

Not equal
 

>

Greater than
 

<

Less than
 

>=

Greater than or equal to
 

<=

Less than or equal to
 

IN-RANGE

Range check (alphanumeric, wide, and numeric)
 

IN-ALPHA

Alphanumeric or wide match
 

 

The IN-RANGE and IN-ALPHA relational operators can apply to wide fields provided that both strings are of the same type.

 

Relational expressions are often used as tests in PROIV conditional and repetitive statements.  Examples:

COUNTER < 100

This expression tests the variable COUNTER to see if it is less than 100
 

IF BALANCE >= LIMIT
THEN statement(s)
ENDIF

This logic determines if a customer's current BALANCE is greater than or equal to their credit LIMIT.  The statements between THEN and ENDIF are executed only if the expression BALANCE >= LIMIT evaluates to True. 

 

Comment on this topic

Topic ID: 520009