PL/1 offers three similar functions for looking in strings:
INDEX, which resembles our EXAMINE ... FOR ... POSITION IN ....
SEARCH, which returns the position of the first matching character of a given set in a target string
VERIFY, which returns the position of the first character in a target string which is NOT part of a given set.
You can compare SEARCH with strstr().
VERIFY is more or less the opposite of SEARCH: it returns the position of the first foreign character.
Use Case | Any kind of string manipulation where search or verification is needed, e.g. search the first digit. |
This functionality is available on GitHub project as a code sample.
https://github.com/SoftwareAG/adabas-natural-code-samples/tree/main/Search_Verify