Previous Topic: FIND / GET Selection CriteriaNext Topic: Expression


FIND / GET Comparison-Expression

Comparison-expression is used in the FIND/GET WHERE criteria clause and in the COMPUTE GROUP BY HAVING criteria clause.

Access mode: The syntax below is invalid when the access switch is set to IDMS.

Syntax:

►►─┬─ function-expression ─┬──────────────────────────────────────────────────►
   └─ field-reference ─────┘

 ►─┬─┬─┬─ = ──┬─┬─ data-value ─┬─ THRU ─┬─ data-value ─┬──────────────────────►◄
   │ │ ├─ EQ ─┤ │              └─ TO ───┘              │
   │ │ └─ IS ─┘ │                                      │
   │ └─┬─ ¬= ─┬─┘                                      │
   │   └─ NE ─┘                                        │
   ├─ MATches mask-value ──────────────────────────────┤
   ├─ CONtains ─┬─ character-string ─┬─────────────────┤
   │            └─ mask-value ───────┘                 │
   └─┬─┬─ = ──┬─┬─ expression ─────────────────────────┘
     │ ├─ EQ ─┤ │
     │ └─ IS ─┘ │
     ├─┬─ ¬= ─┬─┤
     │ └─ NE ─┘ │
     ├─┬─ >= ─┬─┤
     │ └─ GE ─┘ │
     ├─┬─ > ──┬─┤
     │ └─ GT ─┘ │
     ├─┬─ <= ─┬─┤
     │ └─ LE ─┘ │
     └─┬─ < ──┬─┘
       └─ LT ─┘

Syntax rules:

function-expression

Allows you to use built-in aggregate functions to evaluate data. You can nest built-in functions.

field-reference

Note: For more information, see FIND / GET and COMPUTE Field-Reference Clause, later in this chapter.

= ¬= data-value

Specifies a range of data values to which the named field is compared.

THRU/TO data-value

Specifies a range of data values to which the named field is compared.

THRU indicates an inclusive range; TO indicates an exclusive range.

MATCHES mask-value

Specifies a mask value against which the named field is evaluated, character by character. The match is exact, starting with the first character in the mask. The following characters are available for use in the MATCHES clause:

CONTAINS

Specifies a character string or mask value for which the named field is searched. The CONTAINS value can appear anywhere within the named field. For example, the character string EL appears in FIELD, in ELEMENT, and in COMPEL.

= ¬= >= > <= < expression

Specifies the comparison operator with which the named field is compared.

Note: For more information, see the expansion of expression later in this chapter.

For more information:

Coding Considerations

Built-In Functions and Syntax