SUBPAD Function
Returns a substring that has a length that you specify, using blank padding if necessary.
| Category: | Character |
| Restrictions: | This function is assigned an I18N Level 0 status, and is designed for SBCS data. Do not use this function to process DBCS or MBCS data. For more information, see Internationalization Compatibility. |
| This function is not valid on the CAS server. |
Syntax
Required Arguments
string
specifies a character constant, variable, or expression.
position
is a positive integer that specifies the position of the first character in the substring.
Optional Argument
length
is a nonnegative integer that specifies the length of the substring. If you do not specify length, the SUBPAD function returns the substring that extends from the position that you specify to the end of the string.
Details
Comparisons
-
If the value of length in SUBPAD is zero, SUBPAD returns a zero-length string. If the value of length in SUBSTR is zero, SUBSTR
-
writes a note to the log stating that the third argument is invalid
-
sets _ERROR_=1
-
returns the substring that extends from the position that you specified to the end of the string.
-
-
If the substring that you specify extends past the end of the string, SUBPAD pads the result with blanks to yield the length that you requested. If the substring that you specify extends past the end of the string, SUBSTR
-
writes a note to the log stating that the third argument is invalid
-
sets _ERROR_=1
-
returns the substring that extends from the position that you specified to the end of the string.
-