ENDS_WITH Comparison Operator
TABLE OF CONTENTS
- How do I use ENDS_WITH?
- Syntax
- Rules for the syntax
- Examples: ENDS_WITH in Extract Record Filter
- Examples: ENDS_WITH in Extract Column Logic
How do I use ENDS_WITH?
Tha ENDS_WITH keywords are used as string comparison operators. You can check a string ends with certain characters.
For example, a field with “LONDON” ends with the string “N” and “ON” and even “LONDON”.
ENDS_WITH is an example of string comparisons that return a true or false value that can be part of an IF statement.
ENDS_WITH can only be used at extract-phase time in Extract Record Filter or Extract Column Logic text.
The syntax details of ENDS_WITH are shown below.

Syntax

Rules for the syntax
ENDS_WITH can only be used in Extract Record Filter or Extract Column Logic text.
See also topic: Rules for all Logic Text
Examples: ENDS_WITH in Extract Record Filter
| Example logic text | Meaning | 
|---|---|
| SELECTIF({field3} ENDS_WITH “EEE”) | Select input records where field3 ends with characters “EEE”, and skip all other records. | 
| IF ({field3} ENDS_WITH “EEE”) THEN SELECT ENDIF | Select input records where field3 ends with characters “EEE”, and skip all other records. This example can be written: SELECTIF({field3} ENDS_WITH “EEE”) | 
Examples: ENDS_WITH in Extract Column Logic
| Example logic text | Meaning | 
|---|---|
| IF ({field3} ENDS_WITH “EEE”) THEN COLUMN={field3} ELSE COLUMN = “ “ ENDIF | If field3 ends with characters “EEE” then set the current column to field3, otherwise set the current column to blank. |