Overview | Statement List | Example
SUBSTR('target string',pos,count)
Extracts a specified portion of a character string. The starting position in the target string is specified by the value pos and the number of characters to be extracted is specified by the value count. If the character count exceeds the number of characters in the target string, the substring which returns is the target string.
Parameter |
Description |
'target string' |
The literal string or string variable name of the string from which the specified characters are copied. |
pos |
Character position in the object string where the copying of characters begins. Spaces (blanks) are counted in arriving at the starting position. The pos must be an integer value greater than zero. |
count |
The number of consecutive characters to be copied. Spaces (blanks) are counted in the count. The count must be an integer value greater than zero. |