7.122.1 SUBSTRING Parameters
FIELD |
|---|
Specifies the field from which the string is to be extracted and optionally the start position and length of the string.
The field nominated in this parameter can be type alphanumeric or type numeric. When specifying a specific start position and length for a packed numeric field remember that digit positions and lengths are used not byte positions and lengths.
If no start position is specified for the string then start position 1 is assumed.
If no length is specified for the string then *END is assumed which indicates that all of the string from the start position to the end of the field is to be used.
The start position and length values can be nominated as either a literal value (e.g.: 10) or as the name of a field that contains the value (e.g: #LENGTH).
The start and end positions specified are validated at execution time (since they may be variable). If an invalid start or end position is specified the function will abort with an error message indicating the cause of the failure.
Special notes for substringing an alpha field into a numeric field:
INTO_FIELD |
|---|
Specifies the field into which the string extracted from the field nominated in the FIELD parameter is to be placed.
The field nominated in this parameter can be type alphanumeric or type numeric. When specifying a specific start position and length for a packed numeric field remember that digit positions and lengths are used not byte positions and lengths.
If no start position is specified for the string then start position 1 is assumed.
If no length is specified for the string then *END is assumed which indicates that all of the string from the start position to the end of the field is to be used.
The start position and length values can be nominated as either a literal value (e.g.: 10) or as the name of a field that contains the value (e.g.: #LENGTH).
The start and end positions specified are validated at execution time (since they may be variable). If an invalid start or end position is specified the function will abort with an error message indicating the cause of the failure.