S1 = 'abc<>def'
SUBSTR(S1,3,1) -> 'c'
SUBSTR(S1,4,1) -> 'd'
SUBSTR(S1,3,2) -> 'c<>d'
S2 = '<><.A.B><>'
SUBSTR(S2,1,1) -> '<.A>'
SUBSTR(S2,2,1) -> '<.B>'
SUBSTR(S2,1,2) -> '<.A.B>'
SUBSTR(S2,1,3,'x') -> '<.A.B><>x'
S3 = 'abc<><.A.B>'
SUBSTR(S3,3,1) -> 'c'
SUBSTR(S3,4,1) -> '<.A>'
SUBSTR(S3,3,2) -> 'c<><.A>'
DELSTR(S3,3,1) -> 'ab<><.A.B>'
DELSTR(S3,4,1) -> 'abc<><.B>'
DELSTR(S3,3,2) -> 'ab<.B>'
In EBCDIC, contiguous SO and SI (or SI and SO) between nonblank characters are also removed for comparison.
'<.A>' = '<.A. >' -> 1 /* true */
'<><><.A>' = '<.A><><>' -> 1 /* true */
'<> <.A>' = '<.A>' -> 1 /* true */
'<.A><><.B>' = '<.A.B>' -> 1 /* true */
'abc' < 'ab<. >' -> 0 /* false */
In EBCDIC, leading and trailing contiguous SO and SI (or SI and SO) are also removed when words are separated in a string, but contiguous SO and SI (or SI and SO) in a word are not removed or separated for word operations. Leading and trailing contiguous SO and SI (or SI and SO) of a word are not removed if they are among words that are extracted at the same time.
W1 = '<><. .A. . .B><.C. .D><>'
SUBWORD(W1,1,1) -> '<.A>'
SUBWORD(W1,1,2) -> '<.A. . .B><.C>'
SUBWORD(W1,3,1) -> '<.D>'
SUBWORD(W1,3) -> '<.D>'
W2 = '<.A. .B><.C><> <.D>'
SUBWORD(W2,2,1) -> '<.B><.C>'
SUBWORD(W2,2,2) -> '<.B><.C><> <.D>'