Purpose
Used to compare two values or to compare two character strings to determine if the first string matches or contains the second string.
Syntax
►►─┬─┬─ comparison-value ──────┬── operator ──┬─ comparison-value ──────┬─┬───►◄ │ └─ arithmetic-expression ─┘ └─ arithmetic-expression ─┘ │ │ │ └─ comparison-value ─┬─ CONTAINS ─┬─ comparison-value ─────────────────┘ └─ MATCHES ──┘
Expansion of Comparison-Value
►►─┬─ literal ──────────────────────────────────────────────────────────┬─────►◄ ├─ data-field-name-variable ─────────────────────────────────────────┤ └─ lr-field-name ─┬────────────┬─┬───────────────────────┬─┬───────┬─┘ └ OF lr-name ┘ │ ┌─────────────┐ │ └ OF LR ┘ └ ( ─▼─ subscript ─┴─ ) ┘
Expansion of Comparison-Value
Parameters
Specifies the value to be compared.
Expanded syntax for comparison-value is shown above immediately following the compression expression syntax.
Specifies an arithmetic expression, according to the rules presented in Arithmetic Expressions.
The comparison operators are:
|
Operator |
Synonym |
Meaning |
|---|---|---|
|
EQ |
= |
Equal |
|
NE |
|
Not equal to |
|
GT |
> |
Greater than |
|
LT |
< |
Less than |
|
GE |
|
Greater than or equal to |
|
LE |
|
Less than or equal to |
Searches the left operand for an occurrence of the right operand.
The length of the right operand must be less than or equal to the length of the left operand, and both operands must be EBCDIC or unsigned zoned decimal data types. If the right operand is not entirely contained in the left operand, the outcome of the comparison is false.
Compares the left operand to the right operand, one character at a time, beginning with the leftmost character in each operand. The right operand can contain mask characters, as follows:
Any other character in the right operand matches only itself in the left operand.
A user-supplied variable, expressed as a numeric constant, or the character string itself, enclosed in single quotation marks.
Specifies the name of a variable data field, according to the rules presented in Variable Data Fields.
Specifies the name of a field in a Logical Record Facility record known to the subschema associated with the dialog.
Specifies the name of the record that contains the field referenced by lr-field-name.
This clause is required only if the named field is not unique among the records known to the dialog.
Specifies the applicable occurrence of the field referenced by lr-field-name. This can be a variable field containing the applicable occurrence, the occurrence itself, or an expression.
This clause applies only if the named field is defined as a multiply-occurring field.
Specifies that the value of the named field at the time that the request is issued is used throughout processing of the request.
If the value of the field changes during processing, LRF continues to use the original value. If OF LR is not specified and the value of the field changes during processing of the request, the new value in the dialog's record buffer is used for any further processing of the request.
Usage
Considerations
Both the left and right operands must be EBCDIC or unsigned zoned decimal data types. The length of the string that is compared is set to the length of the shorter of the two operands. If a character in the left operand does not match the corresponding character in the right operand, the outcome of the comparison is false.
|
Copyright © 2014 CA.
All rights reserved.
|
|