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

SUBSTR

SUBSTR returns a substring, specified by y and z, of x.

Read syntax diagramSkip visual syntax diagram>>-SUBSTR(x,y-+----+-)-----------------------------------------><
              '-,z-'
 
x
Expression specifies the string from which the substring is extracted.

x should have CHARACTER type, and if not, it is converted thereto.

y
Expression that specifies the starting position of the substring in x.

y should have FIXED type, and if not, it is converted thereto.

z
Expression that specifies the length of the substring in x.

z should have FIXED type, and if not, it is converted thereto.

If z is zero, a null string is returned. If z is omitted, the substring returned is position y in x to the end of x.

z must be nonnegative, and the values of y and z must be such that the substring lies entirely within the current length of x.

If y = LENGTH(x)+1 and z = 0, then the null string is returned.


Terms of use | Feedback

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