Extracts a substring from an argument.
Category: | Character |
Restriction: | I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only. |
Tip: | DBCS equivalent functions are KSUBSTR and KSUBSTRB. |
specifies a character constant, variable, or expression.
specifies a numeric constant, variable, or expression that is the beginning character position.
specifies a valid SAS variable name.
specifies a numeric constant, variable, or expression that is the length of the substring to extract.
Interaction | If length is zero, a negative value, or larger than the length of the expression that remains in string after position, SAS extracts the remainder of the expression. SAS also sets _ERROR_ to 1 and prints a note to the log indicating that the length argument is invalid. |
Tip | If you omit length, SAS extracts the remainder of the expression. |