Skip to Main Content
Status Under Review
Workspace Natural for z/OS
Created by Philippe Van Coppenolle
Created on Feb 14, 2024

Functions SEARCH and VERIFY

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.