How to: |
The POSIT function finds the starting position of a substring within a source string. For example, the starting position of the substring DUCT in the string PRODUCTION is 4. If the substring is not in the parent string, the function returns the value 0.
POSIT(source_string, length, substring, sublength, output)
where:
Alphanumeric
Is the string to parse.
Integer
Is the number of characters in the source string. If this argument is less than or equal to 0, the function returns a 0.
Alphanumeric
Is the substring whose position you want to find.
Integer
Is the number of characters in substring. If this argument is less than or equal to 0, or if it is greater than length, the function returns a 0.
Integer
POSIT determines the position of the first capital letter I in LAST_NAME and stores the result in a column with the format I2:
POSIT(LAST_NAME, 15, 'I', 1, 'I2')
For STEVENS, the result is 0.
For SMITH, the result is 3.
For IRVING, the result is 1.
iWay Software |