LIKE

Syntax:

C data LIKE C pattern

Return Value:

Y result

Description:

This function searches for a pattern in a character array. Wildcards can be included in the pattern, using the syntax:
* Match any group of characters
? Match any one character
Any other character must match exactly
LIKE is case sensitive
The following rules are used:

  1. If the length of the pattern is 0, LIKE returns TRUE
  2. If the pattern is longer than the data, and the pattern matches up to the end of the data, TRUE is returned if the remaining characters are ' ' (space) or '*'
  3. If the data is longer than the pattern and the pattern matches up to the end of the pattern, the match only succeeds if all the remaining characters in the data are ' ' (space)
Example:

"A. Smith" LIKE "*Sm*" = TRUE
"A. Smith" LIKE "???S*" = TRUE