CompareString and CompareStringNoCase

All validation programs

Compares two values as strings based on the operand, and executes an action if the comparison is true.

CompareString requires the value to match exactly in order to be true; CompareStringNoCase does not consider capitalization when comparing the values.

Format of Parameters

VarA Operand VarB (IfTrueAction)

Where:

VarA A BusinessRules.Variable, Current_Element, or a literal surrounded with double quotes. If Current_Element is used and is empty, processing of the rule stops.
Operand EQ, NE, GT, GE, LT, or LE.
VarB A BusinessRules.Variable, Current_Element, Current_Date, or a literal surrounded with double quotes. If Current_Element is used and is empty, processing of the rule stops.
(IfTrueAction)  Optional. The action to be executed if the comparison is true. If omitted, a generic message is displayed if the comparison is true.

Example. This example checks the PER segment and issues an error message if a telephone number starts with 1. This involved these rules:

Set up a rule that checks the qualifier to see if it is “TE” and, if so, places the first character of the PER04 into a variable that we call TEFirstDigit.

Issue an error message if the variable contains a 1.

Message 32211 is a custom message in file CustomerFSBRERRS.txt.