Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Example
Example

SEARCH returns an unscaled REAL FIXED BINARY value specifying the first position in one string at which any character, bit, graphic or widechar of another string appears. It also allows you to specify the location at which to start searching.

Read syntax diagramSkip visual syntax diagram>>-SEARCH(x,y-+----+-)-----------------------------------------><
              '-,n-'
 
x and y
Expressions. x specifies the string in which to search for any character, bit, graphic or widechar that appears in string y.

If either x or y are the null string, the result is zero.

If y does not occur in x, the result is zero.

n
Expression. n specifies the location within x at which to begin searching. It must have a computational type and is converted to FIXED BINARY(31,0).

Unless 1 <= n <= LENGTH(x)+1, STRINGRANGE condition, if enabled, is raised. Its implicit action and normal return give a result of zero.

The BIFPREC compiler option determines the precision of the result returned.

SEARCH can be used to find delimiters in a string of numbers.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)