The %%$SUBSTR function extracts a substring from the input string. The valid format is
%%$SUBSTR strng startpos len
In this format
A string is returned composed of the specified number of characters from the input string beginning with the character in the specified starting position.
startpos and len must be numbers (or numeric AutoEdit expressions) and greater than zero.
Table 194 Valid %%$SUBSTR Values — Unknown Length
Value |
Description |
---|---|
* |
Control-O calculates the end of the string. |
' ' (Blank) |
Control-O calculates the end of the string, but at least one valid character must be input after the beginning of the string. |
Example
DO SET=%%A = %%$CALCDATE %%$RDATE -1
DO SET=%%AMON = %%$SUBSTR %%A 3 2
On December 1, 2000:
DO SET=%%A = 001130
DO SET=%%AMON = 11
Parent Topic |