BEGINS_WITH Comparison Operator
TABLE OF CONTENTS
- How do I use BEGINS_WITH?
- Syntax
- Rules for the syntax
- Examples: BEGINS_WITH in Extract Record Filter
- Examples: BEGINS_WITH in Extract Column Logic
How do I use BEGINS_WITH?
Tha BEGINS_WITH keywords are used as string comparison operators. You can check a string begins with certain characters.
For example, a field with “LONDON” begins with the string “L” and “LO” and even “LONDON”.
BEGINS_WITH is an example of string comparisons that return a true or false value that can be part of an IF statement.
BEGINS_WITH can only be used at extract-phase time in Extract Record Filter or Extract Column Logic text.
The syntax details of BEGINS_WITH are shown below.
Syntax
Rules for the syntax
BEGINS_WITH can only be used in Extract Record Filter or Extract Column Logic text.
See also topic: Rules for all Logic Text
Examples: BEGINS_WITH in Extract Record Filter
Example logic text | Meaning |
---|---|
SELECTIF({field1} BEGINS_WITH “BBB”) |
Select input records where field1 begins with characters “BBB”, and skip all other records. |
IF ({field1} BEGINS_WITH “BBB”) THEN SELECT ENDIF |
Select input records where field1 begins with characters “BBB”, and skip all other records. This example can be written: SELECTIF({field1} BEGINS_WITH “BBB”) |
Examples: BEGINS_WITH in Extract Column Logic
Example logic text | Meaning |
---|---|
IF ({field1} BEGINS_WITH “BBB”) THEN COLUMN={field1} ELSE COLUMN = “ “ ENDIF |
If field1 begins with characters “BBB” then set the current column to field1, otherwise set the current column to blank. |