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

INDEX

Example

INDEX returns an unscaled REAL FIXED BINARY value indicating the starting position within x of a substring identical to y. You can also specify the location within x where processing begins.

Read syntax diagramSkip visual syntax diagram>>-INDEX(x,y-+----+-)------------------------------------------><
             '-,n-'
 
x
String-expression to be searched.
y
Target string-expression of the search.
n
n specifies the location within x at which to begin processing. It must have a computational type and is converted to FIXED BINARY(31,0).

If y does not occur in x, or if either x or y have zero length, the value zero is returned.

If n is less than 1 or if n is greater than 1 + length(x), the STRINGRANGE condition will be raised, and the result will be 0.

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


Terms of use | Feedback

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