Help >
DDL Substring Function
Version
7.11
DDL Substring Function
The Substring Function
The substring function is used to extract or inspect a portion of a larger string.
substr(string;position;count)
where
stringis a variable, literal, or fieldname
positionis the relative 1 starting character position
countis the number of characters to be involved
Examples:
set %x = substr(%vv;37;1)
Extracts the 37th character of the string contained in %vv and
assigns that value to %x. That is, if the 37th character of %vv
was a Y then %x becomes Y.
set %x = substr(%vv;37;3)
Extracts the 37th, 38th, and 39th characters of the string
contained in %vv and assigns that value to %x. That is, if the
three characters starting in position 37 of %vv were YES then
%x becomes YES.
if substr(%vv;37;1)='Y'
This statement is TRUE if the 37th character of %vv was either
a Y or y (the IF without a K option is not case sensitive).
if substr(%vv;37;3)='YES'
This statement is TRUE if the word YES (or yes) appeared in the
37th, 38th, and 39th character positions of %vv.
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.