Built-in function examples, Abbrev, Compare – IBM SC34-5764-01 User Manual

Page 422: Copies

Advertising
background image

In EBCDIC:

'<.A>' = '<.A. >'

->

1

/* true

*/

'<><><.A>' = '<.A><><>'

->

1

/* true

*/

'<>

<.A>' = '<.A>'

->

1

/* true

*/

'<.A><><.B>' = '<.A.B>'

->

1

/* true

*/

'abc' < 'ab<. >'

->

0

/* false */

5. Word extraction from a string—“Word” means that characters in a string are delimited by an SBCS

or a DBCS blank.

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.

In EBCDIC:

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>'

Built-in Function Examples

Examples for built-in functions, those that support DBCS and follow the rules defined, are given in this
section. For full function descriptions and the syntax diagrams, refer to Chapter 14, “Functions,” on page
171.

ABBREV

In EBCDIC:

ABBREV('<.A.B.C>','<.A.B>')

->

1

ABBREV('<.A.B.C>','<.A.C>')

->

0

ABBREV('<.A><.B.C>','<.A.B>')

->

1

ABBREV('aa<>bbccdd','aabbcc')

->

1

Applying the character comparison and character extraction from a string rules.

COMPARE

In EBCDIC:

COMPARE('<.A.B.C>','<.A.B><.C>')

->

0

COMPARE('<.A.B.C>','<.A.B.D>')

->

3

COMPARE('ab<>cde','abcdx')

->

5

COMPARE('<.A><>','<.A>','<. >')

->

0

Applying the character concatenation for padding, character extraction from a string, and character
comparison rules.

COPIES

In EBCDIC:

COPIES('<.A.B>',2)

->

'<.A.B.A.B>'

COPIES('<.A><.B>',2)

->

'<.A><.B.A><.B>'

COPIES('<.A.B><>',2)

->

'<.A.B><.A.B><>'

Applying the character concatenation rule.

400

CICS TS for VSE/ESA: REXX Guide

Advertising