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

MEMINDEX

Example

MEMINDEX returns an unscaled REAL FIXED BINARY value indicating the starting position within a buffer of a specified substring.

With 3 arguments, the function's syntax is :

Read syntax diagramSkip visual syntax diagram>>-MEMINDEX--(--p--,--n--,--x--)-------------------------------><
 
p
Address of buffer to be searched
n
Length of buffer to be searched.
x
String-expression to use as the target of the search.

With 4 arguments, the function's syntax is

Read syntax diagramSkip visual syntax diagram>>-MEMINDEX--(--p--,--n--,--q--,--m--)------------------------><
 
p
Address of first buffer to be searched.
n
Length of first buffer to be searched.
q
Address of second buffer to use as the target of the search.
m
Length of second buffer to use as the target of the search.

The buffer lengths must have a computational type and will be converted to FIXED BINARY(31,0).

The buffer lengths must be nonnegative

With 3 arguments, the target string-expression must have type CHARACTER (including PICTURE), GRAPHIC or WIDECHAR. The buffer length is interpreted as the number of units of that string type.

With 4 arguments, the buffer lengths specify a number of bytes and the search performed is a character search.

For a VARYING or VARYINGZ string X and string Y, the function MEMINDEX( ADDRDATA(X), LENGTH(X), Y ) will return the same value as INDEX( X, Y ).


Terms of use | Feedback

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