 Perform a raw compare, if desired
Perform a raw compare, if desired
   Use a particular collation
Use a particular collation
   Turn case sensitivity on and off
Turn case sensitivity on and off
  | 
       COMPARE ( string1 , relational-operator , string2 , 
        strength , collation ) | 
 RAW — The AVM compares the two strings using the numeric values in the current code page.
RAW — The AVM compares the two strings using the numeric values in the current code page.
   CASE-SENSITIVE — The AVM performs a case-sensitive comparison of the two strings using the numeric values in either the collation table specified in collation, or the collation table of the client. If you specify this strength with an ICU collation, the AVM applies the ICU TERTIARY strength.
CASE-SENSITIVE — The AVM performs a case-sensitive comparison of the two strings using the numeric values in either the collation table specified in collation, or the collation table of the client. If you specify this strength with an ICU collation, the AVM applies the ICU TERTIARY strength.
   CASE-INSENSITIVE — The AVM performs a case-insensitive comparison of the two strings using the numeric values in either the collation table specified in collation, or the collation table of the client. If you specify this strength with an ICU collation, the AVM applies the ICU SECONDARY strength.
CASE-INSENSITIVE — The AVM performs a case-insensitive comparison of the two strings using the numeric values in either the collation table specified in collation, or the collation table of the client. If you specify this strength with an ICU collation, the AVM applies the ICU SECONDARY strength.
   CAPS — The AVM converts any lowercase letters in the two strings to uppercase letters, based on the settings of the Internal Code Page (-cpinternal) and Case Table (-cpcase) startup parameters, and then performs a raw comparison of the resulting strings. When neither string contains a wildcard character, this option behaves the same as the MATCHES operator.
CAPS — The AVM converts any lowercase letters in the two strings to uppercase letters, based on the settings of the Internal Code Page (-cpinternal) and Case Table (-cpcase) startup parameters, and then performs a raw comparison of the resulting strings. When neither string contains a wildcard character, this option behaves the same as the MATCHES operator.
   PRIMARY — The AVM compares the base characters in the two strings.
PRIMARY — The AVM compares the base characters in the two strings.
   SECONDARY — The AVM compares the base characters and any diacritical marks in the two strings.
SECONDARY — The AVM compares the base characters and any diacritical marks in the two strings.
   TERTIARY — The AVM performs a case-sensitive comparison of the base characters and diacritical marks in the two strings.
TERTIARY — The AVM performs a case-sensitive comparison of the base characters and diacritical marks in the two strings.
   QUATERNARY — The AVM performs a case-sensitive comparison of the base characters and any diacritical marks in the two strings, and distinguishes words with and without punctuation. ICU uses this strength to distinguish between Hiragana and Katakana when applied with the ICU-JA (Japanese) collation. Otherwise, it is the same as TERTIARY.
QUATERNARY — The AVM performs a case-sensitive comparison of the base characters and any diacritical marks in the two strings, and distinguishes words with and without punctuation. ICU uses this strength to distinguish between Hiragana and Katakana when applied with the ICU-JA (Japanese) collation. Otherwise, it is the same as TERTIARY.
   If either or both strings evaluate to the Unknown value (?), COMPARE returns the value indicated in the following table.
If either or both strings evaluate to the Unknown value (?), COMPARE returns the value indicated in the following table.
  | 
       Relational operator
       | 
       Only one string evaluates to ?
       | 
       Both strings evaluate to ?
       | 
| 
       LT (or <)
       | 
       FALSE
       | 
       FALSE
       | 
| 
       LE (or <=)
       | 
       FALSE
       | 
       TRUE
       | 
| 
       EQ (or =)
       | 
       FALSE
       | 
       TRUE
       | 
| 
       GE (or >=)
       | 
       FALSE
       | 
       TRUE
       | 
| 
       GT (or >)
       | 
       FALSE
       | 
       FALSE
       | 
| 
       NE (or <>)
       | 
       TRUE
       | 
       FALSE
       | 
| 
       BEGINS
       | 
       FALSE
       | 
       TRUE
       | 
| 
       MATCHES
       | 
       FALSE
       | 
       TRUE
       | 
 COMPARE returns the Unknown value (?) if one of the following occurs:
COMPARE returns the Unknown value (?) if one of the following occurs:
   relational-operator does not evaluate to a valid value.
relational-operator does not evaluate to a valid value.
   strength does not evaluate to a valid value.
strength does not evaluate to a valid value.
   collation does not evaluate to a collation table residing in the convmap.cp file.
collation does not evaluate to a collation table residing in the convmap.cp file.
   collation evaluates to a collation table that is not defined for the code page corresponding to the -cpinternal startup parameter.
collation evaluates to a collation table that is not defined for the code page corresponding to the -cpinternal startup parameter.
   LONGCHAR variable values are converted to -cpinternal for comparison and must convert without error, or the AVM returns an error.
LONGCHAR variable values are converted to -cpinternal for comparison and must convert without error, or the AVM returns an error.
   With BEGINS, the language-sensitive rules are used only when strength is not RAW or CAPS.
With BEGINS, the language-sensitive rules are used only when strength is not RAW or CAPS.
   With MATCHES, CASE-SENSITIVE is treated as RAW, CASE-INSENSITIVE is treated as CAPS, and the collation is never used.
With MATCHES, CASE-SENSITIVE is treated as RAW, CASE-INSENSITIVE is treated as CAPS, and the collation is never used.